public void BeforeEach() { fixture = new Fixture().Customize(new AutoMoqCustomization()); fixture.Customize <Booking>(c => c .Without(b => b.Lodgment)); fixture.Customize <BookingStatus>(c => c .Without(bs => bs.Bookings)); fixture.Customize <Lodgment>(c => c .Without(l => l.Spot) .Without(l => l.Reviews) .Without(l => l.Bookings)); expectedBookings = fixture.CreateMany <Booking>(); expectedBooking = fixture.Create <Booking>(); expectedBookingStatus = fixture.Create <BookingStatus>(); bookingStatus = fixture.Create <BookingStatus>(); bookingId = fixture.Create <int>(); bookingConfirmationCode = fixture.Create <string>(); bookingStatusName = fixture.Create <string>(); contextBuilderOptions = new DbContextOptionsBuilder <NaturalUruguayContext>(); contextBuilderOptions.UseInMemoryDatabase(databaseName: DataBaseName); context = new NaturalUruguayContext(contextBuilderOptions.Options); context.Database.EnsureDeleted(); repository = new BookingsRepository(context); }
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); }
public void BeforeEach() { fixture = new Fixture().Customize(new AutoMoqCustomization()); contextBuilderOptions = new DbContextOptionsBuilder <NaturalUruguayContext>(); contextBuilderOptions.UseInMemoryDatabase(databaseName: DataBaseName); context = new NaturalUruguayContext(contextBuilderOptions.Options); context.Database.EnsureDeleted(); user = fixture.Create <User>(); expectedUser = fixture.Create <User>(); session = fixture.Create <Session>(); expectedSession = fixture.Create <Session>(); expectedResult = fixture.Create <int>(); login = fixture.Create <LoginModel>(); repository = new SessionsRepository(context); }
public void BeforeEach() { fixture = new Fixture().Customize(new AutoMoqCustomization()); fixture.Customize <Region>(c => c .Without(r => r.Spots)); expectedRegions = fixture.CreateMany <Region>(); expectedRegion = fixture.Create <Region>(); regionId = fixture.Create <int>(); paging = fixture.Create <PagingModel>(); contextBuilderOptions = new DbContextOptionsBuilder <NaturalUruguayContext>(); contextBuilderOptions.UseInMemoryDatabase(databaseName: DataBaseName); context = new NaturalUruguayContext(contextBuilderOptions.Options); context.Database.EnsureDeleted(); repository = new RegionsRepository(context); }