Example #1
0
        public void DeleteTest()
        {
            //Arrange
            DBTimeRegistration timeRegistrationController = new DBTimeRegistration();
            int id = 222;

            //Act

            timeRegistrationController.Delete(id);
            var t = timeRegistrationController.Get(id);

            //Assert
            Assert.AreEqual(t.Id, 0);
            Assert.AreEqual(t.employee.Id, 0);
            Assert.AreEqual(t.task.id, 0);
        }
Example #2
0
        public void GetTest()
        {
            //Arrange
            DBTimeRegistration timeRegistrationController = new DBTimeRegistration();
            int id       = 222;
            var excepted = new TimeRegistartion();

            excepted.Id        = 222;
            excepted.startTime = new DateTime(2018, 12, 19, 12, 27, 12);
            excepted.endTime   = new DateTime(2018, 12, 19, 22, 27, 12);
            //Act
            var TimeRegistration = timeRegistrationController.Get(id);

            //Assert
            Assert.AreEqual(excepted.Id, TimeRegistration.Id);
            Assert.AreEqual(excepted.startTime, TimeRegistration.startTime);
            Assert.AreEqual(excepted.endTime, TimeRegistration.endTime);
        }