示例#1
0
        public void PostDeleteNotNullEmployeeWithSicknessWithoutCalendarItem_false()
        {
            //Arrange
            SickController controller = new SickController(mock.Object);

            //Act
            int    id       = 17;
            string from     = "01.04.2014";
            string to       = "07.04.2014";
            string type     = "SickAbsence";
            string sickness = "GRZ";

            bool result = controller.Delete(id, from, to, type, sickness);

            //Assert
            Assert.IsFalse(result);
        }
示例#2
0
        public void PostDeleteNotNullEmployeeBadDates_false()
        {
            //Arrange
            SickController controller = new SickController(mock.Object);

            //Act
            int    id       = 1;
            string from     = "444448.415444.51474";
            string to       = "54848.5154.54554";
            string type     = "SickAbsence";
            string sickness = "";

            bool result = controller.Delete(id, from, to, type, sickness);

            //Assert
            Assert.IsFalse(result);
        }
示例#3
0
        public void PostDeleteNotNullEmpCorrectDatesBadType_false()
        {
            //Arrange
            SickController controller = new SickController(mock.Object);

            //Act
            int    id       = 11;
            string from     = "01.01.2013";
            string to       = "10.01.2013";
            string type     = "Bad Type";
            string sickness = "";

            bool result = controller.Delete(id, from, to, type, sickness);

            //Assert
            Assert.IsFalse(result);
        }
示例#4
0
        public void PostDeleteNullEmployee_false()
        {
            //Arrange
            SickController controller = new SickController(mock.Object);

            //Act
            int    id       = 0;
            string from     = "";
            string to       = "";
            string type     = "";
            string sickness = "";

            bool result = controller.Delete(id, from, to, type, sickness);

            //Assert
            Assert.IsFalse(result);
        }
示例#5
0
        public void PostDeleteSick_ValidSick_true()
        {
            //Arrange
            SickController controller = new SickController(mock.Object);

            int    id   = 4;
            string from = "24.04.2014";
            string to   = "28.04.2014";



            string type     = "SickAbsence";
            string sickness = "GRZ";

            //Act
            var result = controller.Delete(id, from, to, type, sickness);

            //Assert
            mock.Verify(o => o.DeleteSick(It.IsAny <int>()), Times.Once);
            Assert.IsTrue(result);
        }