public void BeforeEach() { fixture = new Fixture().Customize(new AutoMoqCustomization()); fixture.Customize <Spot>(c => c .Without(x => x.Region)); fixture.Customize <Lodgment>(c => c .Without(x => x.Spot) .Without(l => l.Reviews) .Without(l => l.Bookings)); fixture.Customize <CategorySpot>(c => c .Without(x => x.Category) .Without(x => x.Spot)); expectedLodgments = fixture.CreateMany <Lodgment>(); expectedLodgment = fixture.Create <Lodgment>(); lodgmentId = fixture.Create <int>(); lodgmentName = fixture.Create <string>(); urls = fixture.CreateMany <string>().ToList(); paging = fixture.Create <PagingModel>(); contextBuilderOptions = new DbContextOptionsBuilder <NaturalUruguayContext>(); contextBuilderOptions.UseInMemoryDatabase(databaseName: DataBaseName); context = new NaturalUruguayContext(contextBuilderOptions.Options); context.Database.EnsureDeleted(); repository = new LodgmentsRepository(context); }
public LodgmentsService(ILodgmentsRepository repository, ILodgmentCalculator lodgmentCalculator, IStorageService storageService, IReviewsService reviewsService, IBookingsService bookingsService) { this.repository = repository; this.lodgmentCalculator = lodgmentCalculator; this.storageService = storageService; this.reviewsService = reviewsService; this.bookingsService = bookingsService; }