Ejemplo n.º 1
0
        public void DeleteTaskTypeById_Success_Test()
        {
            // Arrange
            int id = 1;

            // create mock for repository
            var mock = new Mock <ITaskTypeRepository>();

            mock.Setup(s => s.DeleteTaskType(Moq.It.IsAny <int>())).Verifiable();

            // service
            TaskTypeService taskTypeService = new TaskTypeService();

            TaskTypeService.Repository = mock.Object;

            // Act
            taskTypeService.DeleteTaskType(id);

            // Assert
            Assert.IsTrue(true);
        }
Ejemplo n.º 2
0
        public void DeleteTaskType_Success_Test()
        {
            // Arrange
            TaskTypeDTO dto = SampleTaskTypeDTO(1);

            dto.IsDeleted = false;

            // create mock for repository
            var mock = new Mock <ITaskTypeRepository>();

            mock.Setup(s => s.DeleteTaskType(Moq.It.IsAny <R_TaskType>())).Verifiable();

            // service
            TaskTypeService taskTypeService = new TaskTypeService();

            TaskTypeService.Repository = mock.Object;

            // Act
            taskTypeService.DeleteTaskType(dto);

            // Assert
            Assert.IsTrue(true);
        }