Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
bin/Debug/net8.0/SupportApp
bin/Debug/net8.0/SupportApp.dll
bin/Debug/net8.0/SupportApp.pdb
bin/Debug/net8.0/SupportApp.staticwebassets.runtime.json
obj/project.assets.json
obj/project.nuget.cache
obj/SupportApp.csproj.nuget.dgspec.json
obj/SupportApp.csproj.nuget.g.props
obj/Debug/net8.0/apphost
obj/Debug/net8.0/staticwebassets.build.json
obj/Debug/net8.0/staticwebassets.development.json
obj/Debug/net8.0/staticwebassets.pack.json
obj/Debug/net8.0/SupportApp.AssemblyInfo.cs
obj/Debug/net8.0/SupportApp.AssemblyInfoInputs.cache
obj/Debug/net8.0/SupportApp.assets.cache
obj/Debug/net8.0/SupportApp.csproj.AssemblyReference.cache
obj/Debug/net8.0/SupportApp.csproj.CoreCompileInputs.cache
obj/Debug/net8.0/SupportApp.csproj.FileListAbsolute.txt
obj/Debug/net8.0/SupportApp.dll
obj/Debug/net8.0/SupportApp.GeneratedMSBuildEditorConfig.editorconfig
obj/Debug/net8.0/SupportApp.genruntimeconfig.cache
obj/Debug/net8.0/SupportApp.pdb
obj/Debug/net8.0/SupportApp.sourcelink.json
obj/Debug/net8.0/ref/SupportApp.dll
obj/*
bin/*
17 changes: 17 additions & 0 deletions SupportRequestControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using Xunit;
using System.Text.Json;

namespace SupportApp.Tests
{
Expand Down Expand Up @@ -41,6 +42,22 @@ public void AddRequest_AddsNewRequest_AndRedirectsToIndex()
Assert.Equal("Index", redirectToActionResult.ActionName);
}

[Fact]
public void AddRequest_AddsNewRequest_AndIncrementsRequestNumber()
{
// Arrange
var controller = new SupportRequestController();
string customerName = "John Doe";
string description = "Need help with product";

// Act
var viewResult = controller.AddRequest(customerName, description) as ViewResult;
var request = viewResult?.ViewData.Model as SupportRequest;

// Assert
Assert.Equal(request.Id, 1);
}

[Fact]
public void ResolveRequest_ResolvesRequest_AndRedirectsToIndex()
{
Expand Down
Binary file removed bin/Debug/net6.0/Microsoft.AspNetCore.JsonPatch.dll
Binary file not shown.
Binary file not shown.
Binary file removed bin/Debug/net6.0/Newtonsoft.Json.Bson.dll
Binary file not shown.
Binary file removed bin/Debug/net6.0/Newtonsoft.Json.dll
Binary file not shown.
Binary file removed bin/Debug/net6.0/SupportApp
Binary file not shown.
217 changes: 0 additions & 217 deletions bin/Debug/net6.0/SupportApp.deps.json

This file was deleted.

Binary file removed bin/Debug/net6.0/SupportApp.dll
Binary file not shown.
Binary file removed bin/Debug/net6.0/SupportApp.pdb
Binary file not shown.
19 changes: 0 additions & 19 deletions bin/Debug/net6.0/SupportApp.runtimeconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion bin/Debug/net6.0/SupportApp.staticwebassets.runtime.json

This file was deleted.

Binary file removed bin/Debug/net6.0/xunit.abstractions.dll
Binary file not shown.
Binary file removed bin/Debug/net6.0/xunit.assert.dll
Binary file not shown.
Binary file removed bin/Debug/net6.0/xunit.core.dll
Binary file not shown.
Binary file removed bin/Debug/net6.0/xunit.execution.dotnet.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed bin/Debug/net8.0/Microsoft.AspNetCore.JsonPatch.dll
Binary file not shown.
Binary file not shown.
Binary file removed bin/Debug/net8.0/Newtonsoft.Json.Bson.dll
Binary file not shown.
Binary file removed bin/Debug/net8.0/Newtonsoft.Json.dll
Binary file not shown.
Binary file removed bin/Debug/net8.0/SupportApp
Binary file not shown.
Loading