This repository has been archived on 2022-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
DevOpsOpenHack/apis/poi/tests/IntegrationTests/Utilities/DatabaseHelpers.cs

42 lines
1.4 KiB
C#
Raw Permalink Normal View History

2022-11-03 20:41:13 +00:00
using System;
using System.Collections.Generic;
using poi.Data;
using poi.Models;
namespace IntegrationTests.Utilities {
public static class DatabaseHelpers {
public static void InitializeDbForTests (POIContext db) {
db.POIs.AddRange (GetSeedingPois ());
db.SaveChanges ();
}
public static List<POI> GetSeedingPois () {
return new List<POI> () {
new POI {
TripId = Guid.NewGuid ().ToString (),
Latitude = 0,
Longitude = 0,
PoiType = POIType.HardAcceleration,
Timestamp = DateTime.Now,
Deleted = false
},
new POI {
TripId = Guid.NewGuid ().ToString (),
Latitude = 0,
Longitude = 0,
PoiType = POIType.HardBrake,
Timestamp = DateTime.Now,
Deleted = false
},
new POI {
TripId = Guid.NewGuid ().ToString (),
Latitude = 0,
Longitude = 0,
PoiType = POIType.HardAcceleration,
Timestamp = DateTime.Now,
Deleted = false
}
};
}
}
}