Exemplo n.º 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();
        }
Exemplo n.º 3
0
 public LpcLocationRepositoryTest(CoreDataStoreDbFixture fixture, ITestOutputHelper output)
 {
     _dbContext             = fixture.DbContext;
     _lpcLocationRepository = fixture.LpcLocationRepository;
     _output = output;
 }
Exemplo n.º 4
0
 public LpcReportRepository(NycLandmarkContext context)
     : base(context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public LpcLocationRepository(NycLandmarkContext context)
     : base(context)
 {
 }
Exemplo n.º 6
0
 public PlutoRepository(NycLandmarkContext context)
     : base(context)
 {
     _context = context;
 }
Exemplo n.º 7
0
 public LpcLamppostRepository(NycLandmarkContext context)
     : base(context)
 {
 }
Exemplo n.º 8
0
 public LandmarkRepository(NycLandmarkContext context)
     : base(context)
 {
 }
Exemplo n.º 9
0
 public LandmarkRepositoryTest(CoreDataStoreDbFixture fixture, ITestOutputHelper output)
 {
     _landmarkRepository = fixture.LandmarkRepository;
     _dbContext          = fixture.DbContext;
     _output             = output;
 }