Files
criminalmindsapi/server.tests/integrationTests/CharactersControllerIntegrationTests.cs
T

27 lines
786 B
C#
Raw Normal View History

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();
2022-07-05 14:55:50 -05:00
_client.DefaultRequestHeaders.Add("x-api-version", "1");
}
[Fact]
public async Task GetCharacters_RetrievesAllCharacters_Returns200StatusCodeWithCharacters()
{
var response = await _client.GetAsync("/api/characters");
2022-07-05 14:55:50 -05:00
response.StatusCode.Should().Be(HttpStatusCode.OK);
}
}
}