public void UpdateTaskType_Success_Test() { // Arrange TaskTypeDTO dto = SampleTaskTypeDTO(1); // create mock for repository var mock = new Mock <ITaskTypeRepository>(); mock.Setup(s => s.UpdateTaskType(Moq.It.IsAny <R_TaskType>())).Verifiable(); // service TaskTypeService taskTypeService = new TaskTypeService(); TaskTypeService.Repository = mock.Object; // Act taskTypeService.UpdateTaskType(dto); // Assert Assert.IsNotNull(dto); }