public async Task InCorrectCredentialsReturns404() { // Arrange var verifyCommand = new StubICommand<VerifyCustomerParameters, Task<bool>> { ExecuteT0 = (p) => Task.Run(() => false) }; var controller = new CustomerController(verifyCommand); // Act IHttpActionResult result = await controller.VerifyCredentialsAsync("256", "*****@*****.**", "whatever"); // Assert Assert.IsInstanceOfType(result, typeof(NotFoundResult)); }
public async Task InvalidSiteReturns400() { // Arrange var verifyCommand = new StubICommand<VerifyCustomerParameters, Task<bool>> { ExecuteT0 = (p) => { throw new InvalidSiteException(); } }; var controller = new CustomerController(verifyCommand); // Act IHttpActionResult result = await controller.VerifyCredentialsAsync("256", "*****@*****.**", "whatever"); // Assert Assert.IsInstanceOfType(result, typeof(BadRequestErrorMessageResult)); }