public void GetTimeRegistration_ReturnOne_NotExists() { //Arrange var controller = new TimeRegistrationsController(_context); //Act var result = controller.GetTimeRegistration(-10000).Result; //Assert Assert.IsInstanceOfType(result, typeof(NotFoundResult)); }
public void GetTimeRegistration_ReturnOne_OK() { //Arrange var controller = new TimeRegistrationsController(_context); var id = _context.TimeRegistrations.First().TimeRegistrationId; //Act var result = controller.GetTimeRegistration(id).Result; //Assert Assert.IsInstanceOfType(result, typeof(OkObjectResult)); }
public void GetTimeRegistration_ReturnAll_OK() { //Arrange var controller = new TimeRegistrationsController(_context); //Act var registrations = controller.GetTimeRegistration(); //Assert Assert.IsTrue(registrations.Any()); Assert.IsNotNull(registrations.First()); }