Fix for Nullreference exception when public api authenticate endpoint called with invalid username. (#482)

This commit is contained in:
Onur BIYIK
2020-11-14 22:15:08 +03:00
committed by GitHub
parent c2fe05dbd4
commit 2502e01efd
2 changed files with 7 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers
[Theory]
[InlineData("demouser@microsoft.com", AuthorizationConstants.DEFAULT_PASSWORD, true)]
[InlineData("demouser@microsoft.com", "badpassword", false)]
[InlineData("baduser@microsoft.com", "badpassword", false)]
public async Task ReturnsExpectedResultGivenCredentials(string testUsername, string testPassword, bool expectedResult)
{
var request = new AuthenticateRequest()
@@ -38,6 +39,6 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers
var model = stringResponse.FromJson<AuthenticateResponse>();
Assert.Equal(expectedResult, model.Result);
}
}
}
}