예제 #1
0
        public void AddContributionMonetaryReviewer_Success_Test()
        {
            // Arrange
            ContributionMonetaryReviewerDTO dto = SampleContributionMonetaryReviewerDTO(1);

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

            mock.Setup(s => s.AddContributionMonetaryReviewer(Moq.It.IsAny <R_ContributionMonetaryReviewer>())).Returns(1);

            // service
            ContributionMonetaryReviewerService contributionMonetaryReviewerService = new ContributionMonetaryReviewerService();

            ContributionMonetaryReviewerService.Repository = mock.Object;

            // Act
            int id = contributionMonetaryReviewerService.AddContributionMonetaryReviewer(dto);

            // Assert
            Assert.AreEqual(1, id);
            Assert.AreEqual(1, dto.ContributionMonetaryReviewerId);
        }