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

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

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

            // service
            ContributionChannelService contributionChannelService = new ContributionChannelService();

            ContributionChannelService.Repository = mock.Object;

            // Act
            contributionChannelService.DeleteContributionChannel(id);

            // Assert
            Assert.IsTrue(true);
        }
Ejemplo n.º 2
0
        public void DeleteContributionChannel_Success_Test()
        {
            // Arrange
            ContributionChannelDTO dto = SampleContributionChannelDTO(1);

            dto.IsDeleted = false;

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

            mock.Setup(s => s.DeleteContributionChannel(Moq.It.IsAny <R_ContributionChannel>())).Verifiable();

            // service
            ContributionChannelService contributionChannelService = new ContributionChannelService();

            ContributionChannelService.Repository = mock.Object;

            // Act
            contributionChannelService.DeleteContributionChannel(dto);

            // Assert
            Assert.IsTrue(true);
        }