Skip to content

Commit

Permalink
Merge pull request #613 from jpacelli62/master
Browse files Browse the repository at this point in the history
refdata + @bartender filter
  • Loading branch information
msarilar authored Jun 10, 2021
2 parents ab7c587 + 464c737 commit 04cb6a9
Show file tree
Hide file tree
Showing 5 changed files with 576 additions and 16 deletions.
54 changes: 52 additions & 2 deletions EDEngineer.Tests/ReferenceDataIntegrityTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using EDEngineer.Localization;
using EDEngineer.Models.Utils;
Expand Down Expand Up @@ -59,6 +60,7 @@ public void No_engineer_mistyped()
"@Synthesis",
"@Technology",
"@Merchant",
"@Bartender",
"Bill Turner",
"Broo Tarquin",
"Colonel Bris Dekker",
Expand Down Expand Up @@ -92,6 +94,7 @@ public void No_engineer_mistyped()
"Jude Navarro",
"Uma Laszlo",
"Hero Ferrari",
"Yarden Bond",
"Terra Velasquez"
};

Expand Down Expand Up @@ -126,6 +129,38 @@ public void EntryData_are_lowercased()
}
}

[Test]
public void EntryData_has_localization()
{
var entries = JsonConvert.DeserializeObject<List<EntryData>>(Helpers.GetEntryDatasJson());
var languages = JsonConvert.DeserializeObject<Languages>(Helpers.GetLocalizationJson());
var keys = languages.Translations.Select(x => x.Key).ToList();
foreach (var entry in entries)
{
Check.That(keys).Contains(entry.Name);
}
}

[Test]
public void Blueprint_has_localization()
{
var blueprints = JsonConvert.DeserializeObject<List<Blueprint>>(Helpers.GetBlueprintsJson());
var languages = JsonConvert.DeserializeObject<Languages>(Helpers.GetLocalizationJson());
var keys = languages.Translations.Select(x => x.Key).ToList();
foreach (var item in blueprints)
{
if (item.Type != "Unlock")
{
Check.That(keys).Contains(item.Name);
}

foreach (var ingredient in item.Ingredients)
{
Check.That(keys).Contains(ingredient.Name);
}
}
}

[Test]
public void Equipments_are_lowercased()
{
Expand All @@ -144,13 +179,28 @@ public void Equipments_and_blueprints_matches()
var blueprintNames = blueprints.Select(x => x.Name).ToList();
foreach (var equipment in equipments)
{
if(equipment.Code != "flightsuit")
if (equipment.Code != "flightsuit")
{
Check.That(blueprintNames).Contains(equipment.Name);
}
}
}

[Test]
public void Blueprints_and_ingredients_matches()
{
var blueprints = JsonConvert.DeserializeObject<List<Blueprint>>(Helpers.GetBlueprintsJson());
var entryData = JsonConvert.DeserializeObject<List<EntryData>>(Helpers.GetEntryDatasJson());
var ingredientsNames = entryData.Select(x => x.Name).ToList();
foreach (var blueprint in blueprints)
{
foreach (var ingredient in blueprint.Ingredients)
{
Check.That(ingredientsNames).Contains(ingredient.Name);
}
}
}

[Test]
public void Can_load_ingredients()
{
Expand Down
218 changes: 214 additions & 4 deletions EDEngineer/Resources/Data/blueprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -34033,7 +34033,7 @@
"Name": "Kit Fowler",
"Engineers": [
"Domino Green",
"Bartender"
"@Bartender"
],
"Ingredients": [
{
Expand All @@ -34051,7 +34051,7 @@
"Name": "Yarden Bond",
"Engineers": [
"Kit Fowler",
"Bartender"
"@Bartender"
],
"Ingredients": [
{
Expand All @@ -34069,7 +34069,7 @@
"Name": "Wellington Beck",
"Engineers": [
"Hero Ferrari",
"Bartender"
"@Bartender"
],
"Ingredients": [
{
Expand Down Expand Up @@ -34121,7 +34121,7 @@
"Name": "Oden Geiger",
"Engineers": [
"Terra Velasquez",
"Bartender"
"@Bartender"
],
"Ingredients": [
{
Expand Down Expand Up @@ -41172,6 +41172,40 @@
],
"Effects": []
},
{
"Type": "Weapon",
"Name": "Improved Hip Fire Accuracy",
"Engineers": [
"Terra Velasquez"
],
"Ingredients": [
{
"Name": "Optical Lens",
"Size": 5
},
{
"Name": "Aerogel",
"Size": 20
},
{
"Name": "Optical Fibre",
"Size": 25
},
{
"Name": "Metal Coil",
"Size": 10
},
{
"Name": "Electrical Wiring",
"Size": 15
},
{
"Name": "Radioactivity Data",
"Size": 5
}
],
"Effects": []
},
{
"Type": "Suit",
"Name": "Improved jump assist",
Expand Down Expand Up @@ -41401,6 +41435,182 @@
],
"Effects": []
},
{
"Type": "Suit",
"Name": "Quieter footsteps",
"Engineers": [
"Yarden Bond"
],
"Ingredients": [
{
"Name": "Settlement Assault Plans",
"Size": 5
},
{
"Name": "Tactical Plans",
"Size": 10
},
{
"Name": "Patrol Routes",
"Size": 10
},
{
"Name": "Micro Hydraulics",
"Size": 5
},
{
"Name": "Viscoelastic Polymer",
"Size": 15
}
],
"Effects": []
},
{
"Type": "Weapon",
"Name": "Audio Masking",
"Engineers": [
"Yarden Bond"
],
"Ingredients": [
{
"Name": "Audio Logs",
"Size": 5
},
{
"Name": "Patrol Routes",
"Size": 10
},
{
"Name": "Scrambler",
"Size": 10
},
{
"Name": "Transmitter",
"Size": 15
},
{
"Name": "Circuit Board",
"Size": 5
}
],
"Effects": []
},
{
"Type": "Weapon",
"Name": "Higher Accuracy (Kinetic Weapons)",
"Engineers": [
"Yarden Bond"
],
"Ingredients": [
{
"Name": "Extraction Yield Data",
"Size": 10
},
{
"Name": "Biometric Data",
"Size": 5
},
{
"Name": "Combatant Performance",
"Size": 10
},
{
"Name": "Viscoelastic Polymer",
"Size": 10
},
{
"Name": "RDX",
"Size": 10
}
],
"Effects": []
},
{
"Type": "Weapon",
"Name": "Higher Accuracy (Thermal Weapons)",
"Engineers": [
"Yarden Bond"
],
"Ingredients": [
{
"Name": "Radioactivity Data",
"Size": 5
},
{
"Name": "Combatant Performance",
"Size": 10
},
{
"Name": "Metal Coil",
"Size": 10
},
{
"Name": "Optical Lens",
"Size": 5
},
{
"Name": "Electrical Wiring",
"Size": 15
}
],
"Effects": []
},
{
"Type": "Weapon",
"Name": "Higher Accuracy (Plasma Weapons)",
"Engineers": [
"Yarden Bond"
],
"Ingredients": [
{
"Name": "Chemical Patents",
"Size": 5
},
{
"Name": "Combatant Performance",
"Size": 10
},
{
"Name": "Chemical Catalyst",
"Size": 10
},
{
"Name": "Electromagnet",
"Size": 10
},
{
"Name": "Metal Coil",
"Size": 10
}
],
"Effects": []
},
{
"Type": "Suit",
"Name": "Combat Movement Speed",
"Engineers": [
"Terra Velasquez"
],
"Ingredients": [
{
"Name": "Evacuation Protocols",
"Size": 10
},
{
"Name": "Genetic Research",
"Size": 5
},
{
"Name": "Epinephrine",
"Size": 10
},
{
"Name": "pH Neutraliser",
"Size": 15
}
],
"Effects": []
},
{
"Type": "Suit",
"Name": "Artemis",
Expand Down
Loading

0 comments on commit 04cb6a9

Please sign in to comment.