Beispiel #1
0
        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(s => s.Spot));
            expectedSpots         = fixture.CreateMany <Spot>();
            expectedSpot          = fixture.Create <Spot>();
            expectedCategory      = fixture.Create <Category>();
            spotId                = fixture.Create <int>();
            regionId              = fixture.Create <int>();
            spotName              = fixture.Create <string>();
            paging                = fixture.Create <PagingModel>();
            contextBuilderOptions = new DbContextOptionsBuilder <NaturalUruguayContext>();
            contextBuilderOptions.UseInMemoryDatabase(databaseName: DataBaseName);
            context = new NaturalUruguayContext(contextBuilderOptions.Options);
            context.Database.EnsureDeleted();

            repository = new SpotsRepository(context);
        }
Beispiel #2
0
 public SpotsService(ISpotsRepository repository, ILodgmentsService lodgmentsService,
                     IStorageService storageService, IReportsService reportsService)
 {
     this.repository       = repository;
     this.lodgmentsService = lodgmentsService;
     this.storageService   = storageService;
     this.reportsService   = reportsService;
 }