Skip to content

Commit

Permalink
Reduce number of seeded boreholes
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Feb 8, 2024
1 parent 30720a6 commit f25ae4f
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion src/api/BdmsContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void SeedData(this BdmsContext context)

// Seed Boreholes
var borehole_ids = 1_000_000;
var boreholeRange = Enumerable.Range(borehole_ids, 10000).ToList();
var boreholeRange = Enumerable.Range(borehole_ids, 3000).ToList();
var fakeBoreholes = new Faker<Borehole>()
.StrictMode(true)
.RuleFor(o => o.Id, f => borehole_ids++)
Expand Down
2 changes: 1 addition & 1 deletion tests/Controllers/ChronostratigraphyControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task GetAllEntriesAsync()
var response = await controller.GetAsync().ConfigureAwait(false);
IEnumerable<ChronostratigraphyLayer>? chronostratigraphies = response;
Assert.IsNotNull(chronostratigraphies);
Assert.AreEqual(100000, chronostratigraphies.Count());
Assert.AreEqual(30000, chronostratigraphies.Count());
}

[TestMethod]
Expand Down
4 changes: 2 additions & 2 deletions tests/Controllers/CoordinateControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task MigrateCoordinates()
(b.OriginalReferenceSystem == ReferenceSystem.LV95 && b.LocationX != null && b.LocationY != null) ||
(b.OriginalReferenceSystem == ReferenceSystem.LV03 && b.LocationXLV03 != null && b.LocationYLV03 != null)).Count();

await AssertMigrateCoordinatesAsync(onlyMissing: false, boreholesWithSetSourceCoordinates, 10004, () =>
await AssertMigrateCoordinatesAsync(onlyMissing: false, boreholesWithSetSourceCoordinates, 3004, () =>
{
AssertLV95BoreholeWithAllCoordinatesSet(lV95BoreholeWithAllCoordinatesSet);
AssertLV95BoreholeWithMissingDestCoordinates(lV95BoreholeWithMissingDestCoordinates);
Expand Down Expand Up @@ -97,7 +97,7 @@ public async Task MigrateCoordinatesWithMissingDestinationLocationOnly()
(b.LocationX == null || b.LocationY == null)))
.Count();

await AssertMigrateCoordinatesAsync(onlyMissing: true, boreholesWithMissingSourceCoordinates, 10004, () =>
await AssertMigrateCoordinatesAsync(onlyMissing: true, boreholesWithMissingSourceCoordinates, 3004, () =>
{
AssertUnchanged(lV95BoreholeWithAllCoordinatesSet);
AssertLV95BoreholeWithMissingDestCoordinates(lV95BoreholeWithMissingDestCoordinates);
Expand Down
2 changes: 1 addition & 1 deletion tests/Controllers/FaciesDescriptionControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task GetAllEntriesAsync()
var response = await controller.GetAsync().ConfigureAwait(false);
IEnumerable<FaciesDescription>? faciesDescriptions = response;
Assert.IsNotNull(faciesDescriptions);
Assert.AreEqual(100_000, faciesDescriptions.Count());
Assert.AreEqual(30_000, faciesDescriptions.Count());
}

[TestMethod]
Expand Down
32 changes: 16 additions & 16 deletions tests/Controllers/FieldMeasurementControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ public async Task GetEntriesByBoreholeIdForInexistentId()
[TestMethod]
public async Task GetEntriesByBoreholeId()
{
var response = await controller.GetAsync(1003503).ConfigureAwait(false);
var response = await controller.GetAsync(1000325).ConfigureAwait(false);
IEnumerable<FieldMeasurement>? fieldMeasurements = response;
Assert.IsNotNull(fieldMeasurements);
Assert.AreEqual(1, fieldMeasurements.Count());
var fieldMeasurement = fieldMeasurements.Single();

Assert.AreEqual(fieldMeasurement.Id, 12000484);
Assert.AreEqual(fieldMeasurement.Id, 12000005);
Assert.AreEqual(fieldMeasurement.Type, ObservationType.FieldMeasurement);
Assert.AreEqual(fieldMeasurement.Duration, 456.94812978615431);
Assert.AreEqual(fieldMeasurement.FromDepthM, 1307.7461903303611);
Assert.AreEqual(fieldMeasurement.ToDepthM, 4604.7917423834051);
Assert.AreEqual(fieldMeasurement.FromDepthMasl, 1024.69292653524);
Assert.AreEqual(fieldMeasurement.ToDepthMasl, 3376.63523513248);
Assert.AreEqual(fieldMeasurement.CompletionFinished, true);
Assert.AreEqual(fieldMeasurement.Comment, "Nesciunt illo nesciunt repellat esse enim qui.");
Assert.AreEqual(fieldMeasurement.Duration, 3922.1102170027375);
Assert.AreEqual(fieldMeasurement.FromDepthM, 6.508998146052006);
Assert.AreEqual(fieldMeasurement.ToDepthM, 1446.5446650011208);
Assert.AreEqual(fieldMeasurement.FromDepthMasl, 1554.9724295800424);
Assert.AreEqual(fieldMeasurement.ToDepthMasl, 3565.501249085414);
Assert.AreEqual(fieldMeasurement.CompletionFinished, false);
Assert.AreEqual(fieldMeasurement.Comment, "Accusamus voluptates aut sit ducimus.");
Assert.AreEqual(fieldMeasurement.ReliabilityId, 15203159);
Assert.AreEqual(fieldMeasurement.SampleTypeId, 15203210);
Assert.AreEqual(fieldMeasurement.ParameterId, 15203216);
Assert.AreEqual(fieldMeasurement.Value, 4819.7414077738031);
Assert.AreEqual(fieldMeasurement.SampleTypeId, 15203209);
Assert.AreEqual(fieldMeasurement.ParameterId, 15203220);
Assert.AreEqual(fieldMeasurement.Value, 744.319461402632);
}

[TestMethod]
Expand All @@ -90,7 +90,7 @@ public async Task EditAsyncValidEntityUpdatesEntity()
ToDepthMasl = 78.0043,
CompletionFinished = true,
Comment = "Test comment",
BoreholeId = 1008104,
BoreholeId = 1001104,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 4).Id,
SampleTypeId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.FieldMeasurementSampleTypeSchema).Single(c => c.Geolcode == 3).Id,
ParameterId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.FieldMeasurementParameterSchema).Single(c => c.Geolcode == 3).Id,
Expand All @@ -110,7 +110,7 @@ public async Task EditAsyncValidEntityUpdatesEntity()
ToDepthMasl = 27603.2,
CompletionFinished = true,
Comment = "Updated test comment",
BoreholeId = 1008105,
BoreholeId = 1001105,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 2).Id,
SampleTypeId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.FieldMeasurementSampleTypeSchema).Single(c => c.Geolcode == 1).Id,
ParameterId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.FieldMeasurementParameterSchema).Single(c => c.Geolcode == 1).Id,
Expand Down Expand Up @@ -168,7 +168,7 @@ public async Task CreateAndDeleteFieldMeasurementAsync()
ToDepthMasl = 2633.2,
CompletionFinished = false,
Comment = "New test comment",
BoreholeId = 1006493,
BoreholeId = 1001493,
ReliabilityId = context.Codelists.Where(c => c.Schema == "observation_reliability").Single(c => c.Geolcode == 3).Id,
SampleTypeId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.FieldMeasurementSampleTypeSchema).Single(c => c.Geolcode == 1).Id,
ParameterId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.FieldMeasurementParameterSchema).Single(c => c.Geolcode == 1).Id,
Expand All @@ -190,7 +190,7 @@ public async Task CreateAndDeleteFieldMeasurementAsync()
Assert.AreEqual(newFieldMeasurement.ToDepthMasl, 2633.2);
Assert.AreEqual(newFieldMeasurement.CompletionFinished, false);
Assert.AreEqual(newFieldMeasurement.Comment, "New test comment");
Assert.AreEqual(newFieldMeasurement.BoreholeId, 1006493);
Assert.AreEqual(newFieldMeasurement.BoreholeId, 1001493);
Assert.AreEqual(newFieldMeasurement.ReliabilityId, 15203158);
Assert.AreEqual(newFieldMeasurement.SampleTypeId, 15203209);
Assert.AreEqual(newFieldMeasurement.ParameterId, 15203214);
Expand Down
32 changes: 16 additions & 16 deletions tests/Controllers/GroundwaterLevelMeasurementControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ public async Task GetEntriesByBoreholeIdForInexistentId()
[TestMethod]
public async Task GetEntriesByBoreholeId()
{
var response = await controller.GetAsync(1003486).ConfigureAwait(false);
var response = await controller.GetAsync(1000595).ConfigureAwait(false);
IEnumerable<GroundwaterLevelMeasurement>? groundwaterLevelMeasurements = response;
Assert.IsNotNull(groundwaterLevelMeasurements);
Assert.AreEqual(1, groundwaterLevelMeasurements.Count());
var groundwaterLevelMeasurement = groundwaterLevelMeasurements.Single();

Assert.AreEqual(groundwaterLevelMeasurement.Id, 12000038);
Assert.AreEqual(groundwaterLevelMeasurement.Id, 12000009);
Assert.AreEqual(groundwaterLevelMeasurement.Type, ObservationType.GroundwaterLevelMeasurement);
Assert.AreEqual(groundwaterLevelMeasurement.Duration, 1700.4810961715325);
Assert.AreEqual(groundwaterLevelMeasurement.FromDepthM, 419.68191535290418);
Assert.AreEqual(groundwaterLevelMeasurement.ToDepthM, 2290.306989747708);
Assert.AreEqual(groundwaterLevelMeasurement.FromDepthMasl, 3115.1974325017995);
Assert.AreEqual(groundwaterLevelMeasurement.ToDepthMasl, 2383.621127038552);
Assert.AreEqual(groundwaterLevelMeasurement.CompletionFinished, true);
Assert.AreEqual(groundwaterLevelMeasurement.Comment, "Ut sint cum deleniti nisi et.");
Assert.AreEqual(groundwaterLevelMeasurement.Duration, 3955.791535689864);
Assert.AreEqual(groundwaterLevelMeasurement.FromDepthM, 2480.3481396256702);
Assert.AreEqual(groundwaterLevelMeasurement.ToDepthM, 3821.0916134552526);
Assert.AreEqual(groundwaterLevelMeasurement.FromDepthMasl, 1289.6360662978311);
Assert.AreEqual(groundwaterLevelMeasurement.ToDepthMasl, 4179.667294897915);
Assert.AreEqual(groundwaterLevelMeasurement.CompletionFinished, false);
Assert.AreEqual(groundwaterLevelMeasurement.Comment, "Libero voluptate corrupti et iste iure.");
Assert.AreEqual(groundwaterLevelMeasurement.ReliabilityId, 15203157);
Assert.AreEqual(groundwaterLevelMeasurement.KindId, 15203205);
Assert.AreEqual(groundwaterLevelMeasurement.LevelM, 1892.1894153515759);
Assert.AreEqual(groundwaterLevelMeasurement.LevelMasl, 1077.2712865179737);
Assert.AreEqual(groundwaterLevelMeasurement.KindId, 15203204);
Assert.AreEqual(groundwaterLevelMeasurement.LevelM, 4345.999004703014);
Assert.AreEqual(groundwaterLevelMeasurement.LevelMasl, 4723.28331899237);
}

[TestMethod]
Expand All @@ -90,7 +90,7 @@ public async Task EditAsyncValidEntityUpdatesEntity()
ToDepthMasl = 78.0043,
CompletionFinished = true,
Comment = "Test comment",
BoreholeId = 1008104,
BoreholeId = 1000595,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 4).Id,
KindId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.GroundwaterLevelMeasurementKindSchema).Single(c => c.Geolcode == 3).Id,
LevelM = 0.0,
Expand All @@ -110,7 +110,7 @@ public async Task EditAsyncValidEntityUpdatesEntity()
ToDepthMasl = 27603.2,
CompletionFinished = true,
Comment = "Updated test comment",
BoreholeId = 1008105,
BoreholeId = 1000595,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 2).Id,
KindId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.GroundwaterLevelMeasurementKindSchema).Single(c => c.Geolcode == 1).Id,
LevelM = 1.1,
Expand Down Expand Up @@ -168,7 +168,7 @@ public async Task CreateAndDeleteGroundwaterLevelMeasurementAsync()
ToDepthMasl = 2633.2,
CompletionFinished = false,
Comment = "New test comment",
BoreholeId = 1006493,
BoreholeId = 1000595,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 3).Id,
KindId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.GroundwaterLevelMeasurementKindSchema).Single(c => c.Geolcode == 2).Id,
LevelM = 348.4563,
Expand All @@ -190,7 +190,7 @@ public async Task CreateAndDeleteGroundwaterLevelMeasurementAsync()
Assert.AreEqual(newGroundwaterLevelMeasurement.ToDepthMasl, 2633.2);
Assert.AreEqual(newGroundwaterLevelMeasurement.CompletionFinished, false);
Assert.AreEqual(newGroundwaterLevelMeasurement.Comment, "New test comment");
Assert.AreEqual(newGroundwaterLevelMeasurement.BoreholeId, 1006493);
Assert.AreEqual(newGroundwaterLevelMeasurement.BoreholeId, 1000595);
Assert.AreEqual(newGroundwaterLevelMeasurement.ReliabilityId, 15203158);
Assert.AreEqual(newGroundwaterLevelMeasurement.KindId, 15203204);
Assert.AreEqual(newGroundwaterLevelMeasurement.LevelM, 348.4563);
Expand Down
42 changes: 21 additions & 21 deletions tests/Controllers/HydrotestControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ public async Task GetEntriesByBoreholeIdForInexistentId()
[TestMethod]
public async Task GetEntriesByBoreholeId()
{
IEnumerable<Hydrotest>? hydrotests = await controller.GetAsync(1005438).ConfigureAwait(false);
IEnumerable<Hydrotest>? hydrotests = await controller.GetAsync(1002658).ConfigureAwait(false);
Assert.IsNotNull(hydrotests);
Assert.AreEqual(1, hydrotests.Count());
var hydrotest = hydrotests.Single();

Assert.AreEqual(hydrotest.Id, 12000069);
Assert.AreEqual(hydrotest.Id, 12000441);
Assert.AreEqual(hydrotest.Type, ObservationType.Hydrotest);
Assert.AreEqual(hydrotest.Duration, 4461.0113159967641);
Assert.AreEqual(hydrotest.FromDepthM, 4594.9352618199473);
Assert.AreEqual(hydrotest.ToDepthM, 4446.2958402672293);
Assert.AreEqual(hydrotest.FromDepthMasl, 2308.5906170646617);
Assert.AreEqual(hydrotest.ToDepthMasl, 3394.1579820854395);
Assert.AreEqual(hydrotest.Duration, 2594.3739538995428);
Assert.AreEqual(hydrotest.FromDepthM, 4707.9754194244624);
Assert.AreEqual(hydrotest.ToDepthM, 324.16204650148848);
Assert.AreEqual(hydrotest.FromDepthMasl, 2627.3088318190112);
Assert.AreEqual(hydrotest.ToDepthMasl, 523.60024264808749);
Assert.AreEqual(hydrotest.CompletionFinished, false);
Assert.AreEqual(hydrotest.Comment, "Libero debitis impedit cumque sit dolorum dignissimos.");
Assert.AreEqual(hydrotest.ReliabilityId, 15203156);
Assert.AreEqual(hydrotest.Comment, "Inventore velit vitae laboriosam.");
Assert.AreEqual(hydrotest.ReliabilityId, 15203157);

// Assert hydrotestresult
Assert.AreEqual(hydrotest.HydrotestResults.Count, 10);
var testResult = hydrotest.HydrotestResults.Single(r => r.Id == 13000375);
Assert.AreEqual(testResult.ParameterId, 15203201);
Assert.AreEqual(testResult.Value, 4390.010689483961);
Assert.AreEqual(testResult.MaxValue, 3484.6578809254142);
Assert.AreEqual(testResult.MinValue, 3823.8737230477263);
Assert.AreEqual(testResult.HydrotestId, 12000069);
Assert.AreEqual(hydrotest.HydrotestResults.Count, 11);
var testResult = hydrotest.HydrotestResults.Single(r => r.Id == 13000009);
Assert.AreEqual(testResult.ParameterId, 15203199);
Assert.AreEqual(testResult.Value, 2434.3317137124632);
Assert.AreEqual(testResult.MaxValue, 2884.2150221547181);
Assert.AreEqual(testResult.MinValue, 4675.6807535866656);
Assert.AreEqual(testResult.HydrotestId, 12000441);
}

[TestMethod]
Expand All @@ -95,7 +95,7 @@ public async Task EditAsyncValidEntityUpdatesEntity()
ToDepthMasl = 78.0043,
CompletionFinished = true,
Comment = "Test comment",
BoreholeId = 1008104,
BoreholeId = 1002431,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 4).Id,
CodelistIds = new List<int> { context.Codelists.Where(c => c.Schema == HydrogeologySchemas.HydrotestKindSchema).Single(c => c.Geolcode == 1).Id }, // test kind
};
Expand All @@ -113,7 +113,7 @@ public async Task EditAsyncValidEntityUpdatesEntity()
ToDepthMasl = 27603.2,
CompletionFinished = true,
Comment = "Updated test comment",
BoreholeId = 1008105,
BoreholeId = 1002431,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 2).Id,
CodelistIds = new List<int> { context.Codelists.Where(c => c.Schema == HydrogeologySchemas.HydrotestKindSchema).Single(c => c.Geolcode == 3).Id, 15203187, 15203189 },
};
Expand Down Expand Up @@ -169,7 +169,7 @@ public async Task CreateAndDeleteHydrotestAsync()
ToDepthMasl = 2633.2,
CompletionFinished = false,
Comment = "New test comment",
BoreholeId = 1006493,
BoreholeId = 1002431,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 3).Id,
CodelistIds = new List<int>() { context.Codelists.Where(c => c.Schema == HydrogeologySchemas.HydrotestKindSchema).Single(c => c.Geolcode == 2).Id },
HydrotestResults = new List<HydrotestResult>() { new HydrotestResult { ParameterId = 15203194 } },
Expand All @@ -191,7 +191,7 @@ public async Task CreateAndDeleteHydrotestAsync()
Assert.AreEqual(newHydrotest.ToDepthMasl, 2633.2);
Assert.AreEqual(newHydrotest.CompletionFinished, false);
Assert.AreEqual(newHydrotest.Comment, "New test comment");
Assert.AreEqual(newHydrotest.BoreholeId, 1006493);
Assert.AreEqual(newHydrotest.BoreholeId, 1002431);
Assert.AreEqual(newHydrotest.ReliabilityId, 15203158);
CollectionAssert.Contains((System.Collections.ICollection)newHydrotest.CodelistIds!, 15203171); // Test kind Id

Expand All @@ -208,7 +208,7 @@ public async Task CreateHydrotestWithSeveralTestKinds()
var newHydrotest = new Hydrotest
{
Type = ObservationType.Hydrotest,
BoreholeId = 1006493,
BoreholeId = 1002431,
ReliabilityId = context.Codelists.Where(c => c.Schema == HydrogeologySchemas.ObservationReliabilitySchema).Single(c => c.Geolcode == 2).Id,
CodelistIds = new List<int>()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Controllers/LayerControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task GetAllEntriesAsync()
var response = await controller.GetAsync().ConfigureAwait(false);
IEnumerable<Layer>? layers = response?.Value;
Assert.IsNotNull(layers);
Assert.AreEqual(100000, layers.Count());
Assert.AreEqual(30_000, layers.Count());
}

[TestMethod]
Expand Down
2 changes: 1 addition & 1 deletion tests/Controllers/LithologicalDescriptionControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task GetAllEntriesAsync()
var response = await controller.GetAsync().ConfigureAwait(false);
IEnumerable<LithologicalDescription>? lithologicalDescriptions = response;
Assert.IsNotNull(lithologicalDescriptions);
Assert.AreEqual(100_000, lithologicalDescriptions.Count());
Assert.AreEqual(30_000, lithologicalDescriptions.Count());
}

[TestMethod]
Expand Down
Loading

0 comments on commit f25ae4f

Please sign in to comment.