Exemple #1
0
        public void GetTimeRegistration_ReturnOne_NotExists()
        {
            //Arrange
            var controller = new TimeRegistrationsController(_context);

            //Act
            var result = controller.GetTimeRegistration(-10000).Result;

            //Assert
            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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());
        }