public async Task LoginTests_LoginIncorrect_ReturnsFalse() { // Arrange var request = new { Url = "/login", Body = new { Username = "******", Password = "******" } }; // Act var response = await _client.PostAsync(request.Url, ContentHelper.GetStringContent(request.Body)); var value = await response.Content.ReadAsStringAsync(); // Assert response.EnsureSuccessStatusCode(); Assert.True(value == "false"); }
public async Task LoginTests_LoginCorrect_ReturnsTrue() { // Arrange var request = new { Url = "/login", Body = new { Username = "******", Password = "******" } }; // Act var response = await _client.PostAsync(request.Url, ContentHelper.GetStringContent(request.Body)); var value = await response.Content.ReadAsStringAsync(); // Assert response.EnsureSuccessStatusCode(); // value.Should().Be("true"); // Con FluentAssertions Assert.True(value == "true"); // Sin FluentAssertions }