Exemplo n.º 1
0
        public void GetContributionMonetaryReviewer_Success_Test()
        {
            // Arrange
            int id = 1;
            R_ContributionMonetaryReviewer contributionMonetaryReviewer = SampleContributionMonetaryReviewer(id);

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

            mock.Setup(s => s.GetContributionMonetaryReviewer(Moq.It.IsAny <int>())).Returns(contributionMonetaryReviewer);

            // service
            ContributionMonetaryReviewerService contributionMonetaryReviewerService = new ContributionMonetaryReviewerService();

            ContributionMonetaryReviewerService.Repository = mock.Object;

            // Act
            ContributionMonetaryReviewerDTO result = contributionMonetaryReviewerService.GetContributionMonetaryReviewer(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.ContributionMonetaryReviewerId);
        }