Example #1
0
        public void Verify_Search_AsListing_Should_ReturnAListOfVolumeLocationsWithDataMatchingSearchParametersWithListingMapping()
        {
            // Arrange
            var mockVolumeLocationsRepository = VolumeLocationsMockingSetup.DoMockingSetupForRepository();
            var searchModel = new Mock <IVolumeLocationSearchModel>();
            var mockVolumeLocationsMapper = new Mock <IVolumeLocationMapper>();

            mockVolumeLocationsMapper.Setup(m => m.AreEqual(It.IsAny <IVolumeLocationModel>(), It.IsAny <IVolumeLocation>())).Returns(() => true);
            var businessWorkflow = new VolumeLocationsBusinessWorkflow(mockVolumeLocationsRepository.Object, mockVolumeLocationsMapper.Object);

            // Act
            businessWorkflow.Search(searchModel.Object, true);
            // Assert
            mockVolumeLocationsRepository.Verify(m => m.Search(It.IsAny <IVolumeLocationSearchModel>(), It.IsAny <bool>()), Times.Once);
        }
 public void Verify_Search_Should_ReturnAListOfVolumeLocations()
 {
     // Arrange
     var mockVolumeLocationsRepository = VolumeLocationsMockingSetup.DoMockingSetupForRepository();
     var searchModel = new Mock<IVolumeLocationSearchModel>();
     var mockVolumeLocationsMapper = new Mock<IVolumeLocationMapper>();
     mockVolumeLocationsMapper.Setup(m => m.AreEqual(It.IsAny<IVolumeLocationModel>(), It.IsAny<IVolumeLocation>())).Returns(() => true);
     var businessWorkflow = new VolumeLocationsBusinessWorkflow(mockVolumeLocationsRepository.Object, mockVolumeLocationsMapper.Object);
     // Act
     businessWorkflow.Search(searchModel.Object);
     // Assert
     mockVolumeLocationsRepository.Verify(m => m.Search(It.IsAny<IVolumeLocationSearchModel>(), It.IsAny<bool>()), Times.Once);
 }