Beispiel #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing && _context != null)
     {
         _context.Dispose();
         _context = null;
     }
 }
        private void CreateTestData(NycLandmarkContext dbContext)
        {
            var boroughs    = EnumHelper.EnumToList <Borough>().Select(e => e.GetDescription());
            var objectTypes = EnumHelper.EnumToList <ObjectType>().Select(e => e.GetDescription());

            var i = 0;

            GenFu.GenFu.Configure <LpcReport>()
            .Fill(l => l.Id, () => ++ i)
            .Fill(l => l.LPNumber, () => $"LP-{i,5:D5}")
            .Fill(l => l.LPCId, () => $"{i,5:D5}")
            .Fill(l => l.Borough, () => BaseValueGenerator.GetRandomValue(boroughs))
            .Fill(l => l.ObjectType, () => BaseValueGenerator.GetRandomValue(objectTypes))
            .Fill(l => l.Landmarks);

            _lpcReports = GenFu.GenFu.ListOf <LpcReport>(20);

            dbContext.LPCReports.AddRange(_lpcReports);
            dbContext.SaveChanges();
        }
Beispiel #3
0
 public LpcLocationRepositoryTest(CoreDataStoreDbFixture fixture, ITestOutputHelper output)
 {
     _dbContext             = fixture.DbContext;
     _lpcLocationRepository = fixture.LpcLocationRepository;
     _output = output;
 }
Beispiel #4
0
 public LpcReportRepository(NycLandmarkContext context)
     : base(context)
 {
     _context = context;
 }
Beispiel #5
0
 public LpcLocationRepository(NycLandmarkContext context)
     : base(context)
 {
 }
 public PlutoRepository(NycLandmarkContext context)
     : base(context)
 {
     _context = context;
 }
Beispiel #7
0
 public LpcLamppostRepository(NycLandmarkContext context)
     : base(context)
 {
 }
Beispiel #8
0
 public LandmarkRepository(NycLandmarkContext context)
     : base(context)
 {
 }
Beispiel #9
0
 public LandmarkRepositoryTest(CoreDataStoreDbFixture fixture, ITestOutputHelper output)
 {
     _landmarkRepository = fixture.LandmarkRepository;
     _dbContext          = fixture.DbContext;
     _output             = output;
 }