Esempio n. 1
0
        public void Verify_Search_AsListing_Should_ReturnAListOfEpisodePeopleWithDataMatchingSearchParametersWithListingMapping()
        {
            // Arrange
            var mockEpisodePeopleRepository = EpisodePeopleMockingSetup.DoMockingSetupForRepository();
            var searchModel             = new Mock <IEpisodePersonSearchModel>();
            var mockEpisodePeopleMapper = new Mock <IEpisodePersonMapper>();

            mockEpisodePeopleMapper.Setup(m => m.AreEqual(It.IsAny <IEpisodePersonModel>(), It.IsAny <IEpisodePerson>())).Returns(() => true);
            var businessWorkflow = new EpisodePeopleBusinessWorkflow(mockEpisodePeopleRepository.Object, mockEpisodePeopleMapper.Object);

            // Act
            businessWorkflow.Search(searchModel.Object, true);
            // Assert
            mockEpisodePeopleRepository.Verify(m => m.Search(It.IsAny <IEpisodePersonSearchModel>(), It.IsAny <bool>()), Times.Once);
        }
 public void Verify_Search_Should_ReturnAListOfEpisodePeople()
 {
     // Arrange
     var mockEpisodePeopleRepository = EpisodePeopleMockingSetup.DoMockingSetupForRepository();
     var searchModel = new Mock<IEpisodePersonSearchModel>();
     var mockEpisodePeopleMapper = new Mock<IEpisodePersonMapper>();
     mockEpisodePeopleMapper.Setup(m => m.AreEqual(It.IsAny<IEpisodePersonModel>(), It.IsAny<IEpisodePerson>())).Returns(() => true);
     var businessWorkflow = new EpisodePeopleBusinessWorkflow(mockEpisodePeopleRepository.Object, mockEpisodePeopleMapper.Object);
     // Act
     businessWorkflow.Search(searchModel.Object);
     // Assert
     mockEpisodePeopleRepository.Verify(m => m.Search(It.IsAny<IEpisodePersonSearchModel>(), It.IsAny<bool>()), Times.Once);
 }