public async void Test5() { var admin2 = new REST_Api.ApiModels.Admins { Id = 1, FirstName = "Test", LastName = "Admin", Email = "*****@*****.**", Password = "******", }; var result1 = await _controller.PutToChangePasswordAsync(1, admin2.Password); var goodRequestResult = Assert.IsType <OkObjectResult>(result1); //Assert.Same(Mapper.MapAdmins(admin2).ToString(), goodRequestResult.Value.ToString()); var result2 = await _controller.PutToChangePasswordAsync(5, "1234"); Assert.IsType <NotFoundObjectResult>(result2); }
public async void Test3() { var admin2 = new REST_Api.ApiModels.Admins { Id = 2, FirstName = "Test3", LastName = "Admin", Email = "*****@*****.**", Password = "******", }; var result1 = await _controller.PostAsync(admin2); Assert.IsType <OkObjectResult>(result1); admin2.Email = "*****@*****.**"; var result2 = await _controller.PostAsync(admin2); Assert.IsType <BadRequestObjectResult>(result2); }
public async void Test4() { var admin2 = new REST_Api.ApiModels.Admins { Id = 2, FirstName = "Test3", LastName = "Admin", Email = "*****@*****.**", Password = "******", }; var result1 = await _controller.PutAsync(1, admin2); var goodRequestResult = Assert.IsType <OkObjectResult>(result1); Assert.Same(Mapper.MapAdmins(admin2).ToString(), goodRequestResult.Value.ToString()); var result2 = await _controller.PutAsync(4, admin2); Assert.IsType <NotFoundObjectResult>(result2); }