public void DeleteContributionTypeById_Success_Test() { // Arrange int id = 1; // create mock for repository var mock = new Mock <IContributionTypeRepository>(); mock.Setup(s => s.DeleteContributionType(Moq.It.IsAny <int>())).Verifiable(); // service ContributionTypeService contributionTypeService = new ContributionTypeService(); ContributionTypeService.Repository = mock.Object; // Act contributionTypeService.DeleteContributionType(id); // Assert Assert.IsTrue(true); }
public void DeleteContributionType_Success_Test() { // Arrange ContributionTypeDTO dto = SampleContributionTypeDTO(1); dto.IsDeleted = false; // create mock for repository var mock = new Mock <IContributionTypeRepository>(); mock.Setup(s => s.DeleteContributionType(Moq.It.IsAny <R_ContributionType>())).Verifiable(); // service ContributionTypeService contributionTypeService = new ContributionTypeService(); ContributionTypeService.Repository = mock.Object; // Act contributionTypeService.DeleteContributionType(dto); // Assert Assert.IsTrue(true); }