Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }