added test project and put integration and unit tests under single test project

This commit is contained in:
StevanFreeborn
2022-07-05 14:38:00 -05:00
parent 64662126e1
commit 6d94582686
9 changed files with 52 additions and 194 deletions
@@ -0,0 +1,24 @@
using FluentAssertions;
using Microsoft.AspNetCore.Mvc.Testing;
using System.Net;
namespace server.tests.integrationTests
{
public class CharactersControllerIntegrationTests
{
private readonly HttpClient _client;
public CharactersControllerIntegrationTests()
{
var webAppFactory = new WebApplicationFactory<Program>();
_client = webAppFactory.CreateDefaultClient();
}
[Fact]
public async Task GetCharacters_RetrievesAllCharacters_Returns200StatusCodeWithCharacters()
{
var response = await _client.GetAsync("/api/characters");
response.StatusCode.Should().Be(HttpStatusCode.OK);
}
}
}