public void Instance_Implement_Interface_IAccommodationItemPhotoMerger() { //Arrange var type = typeof(IAccommodationItemPhotoMerge); //Act var merger = new AccommodationItemPhotoMerge(); //Assert Assert.IsInstanceOf(type, merger); }
private static AccommodationService AccommodationsService() { var queryDispatcher = new Mock <IQueryDispatcher>(); queryDispatcher.Setup(p => p.Dispatch(It.IsAny <AccommodationDetailByAccommodationIdAndLanguageIdQuery>())) .Returns(new AccommodationDetail()); var items = new[] { new AccommodationItem { Id = 1 } }; var result = new ResultWithTotalCount <AccommodationItem>() { Result = items }; queryDispatcher.Setup(p => p.Dispatch(It.IsAny <PagedAccommodationItemsByLanguageIdQuery>())).Returns(result); var providerMock = new Mock <IQueryDispatcher>(); var queryFactoryMock = new Mock <IQueryFactory>(); queryFactoryMock.Setup(p => p.Get <AccommodationDetailByAccommodationIdAndLanguageIdQuery>()) .Returns(new AccommodationDetailByAccommodationIdAndLanguageIdQuery(queryDispatcher.Object)); queryFactoryMock.Setup(p => p.Get <PagedAccommodationItemsByLanguageIdQuery>()) .Returns(new PagedAccommodationItemsByLanguageIdQuery(queryDispatcher.Object)); queryFactoryMock.Setup(p => p.Get <PhotosOfAccommodationsByAccommodationIdsQuery>()) .Returns(new PhotosOfAccommodationsByAccommodationIdsQuery(queryDispatcher.Object)); queryFactoryMock.Setup(p => p.Get <AccommodationSuggestionsQuery>()) .Returns(new AccommodationSuggestionsQuery(queryDispatcher.Object)); var mockMerger = new AccommodationItemPhotoMerge(); return(new AccommodationService(queryFactoryMock.Object, mockMerger)); }
private static AccommodationsFacade CreateAccommodationsFacade() { var queryDispatcher = new Mock <IProvider>(); queryDispatcher.Setup(p => p.Execute(It.IsAny <GetAccommodationDetailById>())) .Returns(new AccommodationDetail()); var items = new[] { new AccommodationItem { Id = 1 } }; var result = new ResultWithTotalCount <AccommodationItem>() { Result = items }; queryDispatcher.Setup(p => p.Execute(It.IsAny <GetPagedAccommodationItems>())).Returns(result); var providerMock = new Mock <IProvider>(); providerMock.Setup(p => p.Create <GetAccommodationDetailById>()) .Returns(new GetAccommodationDetailById(queryDispatcher.Object)); providerMock.Setup(p => p.Create <GetPagedAccommodationItems>()) .Returns(new GetPagedAccommodationItems(queryDispatcher.Object)); providerMock.Setup(p => p.Create <GetPhotosOfAccommodations>()) .Returns(new GetPhotosOfAccommodations(queryDispatcher.Object)); var mockMerger = new AccommodationItemPhotoMerge(); return(new AccommodationsFacade(providerMock.Object, mockMerger)); }