public async Task Should_Not_Create_If_Mail_Null() { using (var context = await MockDbContext.GetDbContext()) { controller = new AuthControllerMock(_configuration, context); var userMock = new Authentification.API.Models.User { Password = "******" }; var actionResult = await controller.Logon(userMock); Assert.IsType <BadRequestResult>(actionResult); } }
public async Task Should_Create_User() { using (var context = await MockDbContext.GetDbContext()) { controller = new AuthControllerMock(_configuration, context); var userMock = new Authentification.API.Models.User { Mail = "*****@*****.**", Password = "******", }; var actionResult = await controller.Logon(userMock); Assert.IsType <OkObjectResult>(actionResult); } }