diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-05-22 12:59:32 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-05-22 12:59:32 +0300 |
| commit | 747aa00440eb9b219d989a536b0ff0c959b35143 (patch) | |
| tree | f8b866f8e95c4597cae6b246746c23967e03def6 | |
| parent | a4e2f6753c6c2612444847fd12f1e973a86a4aa4 (diff) | |
| download | Mundus-747aa00440eb9b219d989a536b0ff0c959b35143.tar Mundus-747aa00440eb9b219d989a536b0ff0c959b35143.tar.gz Mundus-747aa00440eb9b219d989a536b0ff0c959b35143.zip | |
Completed all tests (there is still some code that can be tested, but it will be very hard to do so and I am skipping it for now).
17 files changed, 297 insertions, 312 deletions
diff --git a/Mundus/Data/GameEventLogs/GameEventLogContext.cs b/Mundus/Data/GameEventLogs/GameEventLogContext.cs index 7a5dc57..81a7177 100644 --- a/Mundus/Data/GameEventLogs/GameEventLogContext.cs +++ b/Mundus/Data/GameEventLogs/GameEventLogContext.cs @@ -20,6 +20,7 @@ /// Gets DbSet of the game event logs table /// </summary> public DbSet<GameEventLog> GameEventLogs { get; private set; } + public object SingleDataBaseContexts { get; set; } /// <summary> /// Adds a message to the GameEventLogs table diff --git a/Mundus/Mundus.csproj b/Mundus/Mundus.csproj index c5c6d72..7b4094f 100644 --- a/Mundus/Mundus.csproj +++ b/Mundus/Mundus.csproj @@ -44,7 +44,7 @@ <HintPath>..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.12.0\lib\net45\Google.Protobuf.dll</HintPath>
+ <HintPath>..\packages\Google.Protobuf.3.12.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet">
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
@@ -148,7 +148,7 @@ <HintPath>..\packages\Microsoft.EntityFrameworkCore.3.1.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Identity.Client">
- <HintPath>..\packages\Microsoft.Identity.Client.3.0.8\lib\net45\Microsoft.Identity.Client.dll</HintPath>
+ <HintPath>..\packages\Microsoft.Identity.Client.4.14.0\lib\net45\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
diff --git a/Mundus/packages.config b/Mundus/packages.config index 73a1603..b29b53d 100644 --- a/Mundus/packages.config +++ b/Mundus/packages.config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="BouncyCastle" version="1.8.6.1" targetFramework="net47" /> - <package id="Google.Protobuf" version="3.12.0" targetFramework="net47" /> + <package id="Google.Protobuf" version="3.12.1" targetFramework="net47" /> <package id="K4os.Compression.LZ4" version="1.1.11" targetFramework="net47" /> <package id="K4os.Compression.LZ4.Streams" version="1.1.11" targetFramework="net47" /> <package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net47" /> @@ -25,7 +25,7 @@ <package id="Microsoft.Extensions.Logging.Abstractions" version="3.1.4" targetFramework="net47" /> <package id="Microsoft.Extensions.Options" version="3.1.4" targetFramework="net47" /> <package id="Microsoft.Extensions.Primitives" version="3.1.4" targetFramework="net47" /> - <package id="Microsoft.Identity.Client" version="4.13.0" targetFramework="net47" /> + <package id="Microsoft.Identity.Client" version="4.14.0" targetFramework="net47" /> <package id="Microsoft.IdentityModel.JsonWebTokens" version="6.5.1" targetFramework="net47" /> <package id="Microsoft.IdentityModel.Logging" version="6.5.1" targetFramework="net47" /> <package id="Microsoft.IdentityModel.Protocols" version="6.5.1" targetFramework="net47" /> diff --git a/MundusTests/DataTests/DataBaseContextsTests.cs b/MundusTests/DataTests/DataBaseContextsTests.cs index b4f6f56..2c6e977 100644 --- a/MundusTests/DataTests/DataBaseContextsTests.cs +++ b/MundusTests/DataTests/DataBaseContextsTests.cs @@ -1,12 +1,14 @@ -using System; -using Mundus.Data; -using NUnit.Framework; +namespace MundusTests.DataTests +{ + using Mundus.Data; + using NUnit.Framework; -namespace MundusTests.DataTests { [TestFixture] - public static class DataBaseContextsTests { + public static class DataBaseContextsTests + { [Test] - public static void CreatesInstances() { + public static void CreatesInstances() + { Assert.IsNotNull(DataBaseContexts.SContext, "Doesn't create SContext instance"); Assert.IsNotNull(DataBaseContexts.LContext, "Doesn't create LContext instance"); Assert.IsNotNull(DataBaseContexts.UContext, "Doesn't create UContext instance"); diff --git a/MundusTests/DataTests/Mobs/MITests.cs b/MundusTests/DataTests/Mobs/MITests.cs index e37212b..85595d7 100644 --- a/MundusTests/DataTests/Mobs/MITests.cs +++ b/MundusTests/DataTests/Mobs/MITests.cs @@ -1,15 +1,11 @@ namespace MundusTests.DataTests.Mobs { - using Gtk; - using Mundus.Data; using Mundus.Data.Tiles.Mobs; - using Mundus.Data.Windows; using NUnit.Framework; [TestFixture] public static class MITests { - [Test] public static void CreatesPlayerInstance() { diff --git a/MundusTests/DataTests/SuperLayers/LandContextTests.cs b/MundusTests/DataTests/SuperLayers/LandContextTests.cs index 4f4bccb..bf17ec4 100644 --- a/MundusTests/DataTests/SuperLayers/LandContextTests.cs +++ b/MundusTests/DataTests/SuperLayers/LandContextTests.cs @@ -2,7 +2,6 @@ { using System.Linq; using Mundus.Data; - using Mundus.Data.SuperLayers; using Mundus.Data.SuperLayers.DBTables; using NUnit.Framework; @@ -16,12 +15,10 @@ var structure = new LSPlacedTile("structure_stock", 0, 2000, 1000); var ground = new LGPlacedTile("ground_stock", 3000, 4000); - - - DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.LContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.LContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.LContext.SaveChanges(); Assert.AreEqual(mob.stock_id, DataBaseContexts.LContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't add the mob correctly"); Assert.AreEqual(structure.stock_id, DataBaseContexts.LContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't add the structure correctly"); @@ -34,14 +31,12 @@ var mob = new LMPlacedTile("mob_stock", 10, 1000, 1001); var structure = new LSPlacedTile("structure_stock", 4, 2000, 1001); - - - DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.LContext.SaveChanges(); - Assert.IsTrue( DataBaseContexts.LContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 1), "Mob is considered dead (health <= 0), but it shouldnt be"); - Assert.IsTrue( DataBaseContexts.LContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1), "Structure is considered dead (health <= 0), but it shouldn't be"); + Assert.IsTrue(DataBaseContexts.LContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 1), "Mob is considered dead (health <= 0), but it shouldnt be"); + Assert.IsTrue(DataBaseContexts.LContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1), "Structure is considered dead (health <= 0), but it shouldn't be"); } [Test] @@ -50,14 +45,12 @@ var mob = new LMPlacedTile("mob_stock", 10, 1000, 1000); var structure = new LSPlacedTile("structure_stock", 4, 2000, 1000); - - - DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.LContext.SaveChanges(); - Assert.IsFalse( DataBaseContexts.LContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 20), "Mob is considered alive (health > 0), but it shouldnt be"); - Assert.IsFalse( DataBaseContexts.LContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 20), "Structure is considered alive (health > 0), but it shouldn't be"); + Assert.IsFalse(DataBaseContexts.LContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 20), "Mob is considered alive (health > 0), but it shouldnt be"); + Assert.IsFalse(DataBaseContexts.LContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 20), "Structure is considered alive (health > 0), but it shouldn't be"); } [Test] @@ -66,15 +59,15 @@ var mob = new LMPlacedTile("mob_stock", 10, 1000, 1002); var structure = new LSPlacedTile("structure_stock", 4, 2000, 1002); - DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.LContext.SaveChanges(); - DataBaseContexts.LContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3); - DataBaseContexts.LContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1); + DataBaseContexts.LContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3); + DataBaseContexts.LContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1); - Assert.AreEqual(7, DataBaseContexts.LContext.LMobLayer.First(x => x.YPos == mob.YPos && x.XPos == mob.XPos).Health, "Mobs recieve incorrect amount of damage"); - Assert.AreEqual(3, DataBaseContexts.LContext.LStructureLayer.First(x => x.YPos == structure.YPos && x.XPos == structure.XPos).Health, "Structures recieve incorrect amount of damage"); + Assert.AreEqual(7, DataBaseContexts.LContext.LMobLayer.First(x => x.YPos == mob.YPos && x.XPos == mob.XPos).Health, "Mobs recieve incorrect amount of damage"); + Assert.AreEqual(3, DataBaseContexts.LContext.LStructureLayer.First(x => x.YPos == structure.YPos && x.XPos == structure.XPos).Health, "Structures recieve incorrect amount of damage"); } [Test] @@ -84,16 +77,14 @@ var structure = new LSPlacedTile("structure_stock", 0, 2000, 1000); var ground = new LGPlacedTile("ground_stock", 3000, 4000); - + DataBaseContexts.LContext.LMobLayer.Add(mob); + DataBaseContexts.LContext.LStructureLayer.Add(structure); + DataBaseContexts.LContext.LGroundLayer.Add(ground); + DataBaseContexts.LContext.SaveChanges(); - DataBaseContexts.LContext.LMobLayer.Add(mob); - DataBaseContexts.LContext.LStructureLayer.Add(structure); - DataBaseContexts.LContext.LGroundLayer.Add(ground); - DataBaseContexts.LContext.SaveChanges(); - - Assert.AreEqual(mob.stock_id, DataBaseContexts.LContext.GetMobLayerStock(mob.YPos, mob.XPos), "Doesn't get the correct mob layer stock"); - Assert.AreEqual(structure.stock_id, DataBaseContexts.LContext.GetStructureLayerStock(structure.YPos,structure.XPos), "Doesn't get the correct structure layer stock"); - Assert.AreEqual(ground.stock_id, DataBaseContexts.LContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Doesn't get the correct ground layer stock"); + Assert.AreEqual(mob.stock_id, DataBaseContexts.LContext.GetMobLayerStock(mob.YPos, mob.XPos), "Doesn't get the correct mob layer stock"); + Assert.AreEqual(structure.stock_id, DataBaseContexts.LContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Doesn't get the correct structure layer stock"); + Assert.AreEqual(ground.stock_id, DataBaseContexts.LContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Doesn't get the correct ground layer stock"); } [Test] @@ -103,24 +94,21 @@ var structure = new LSPlacedTile("structure_stock", 0, 2000, 1000); var ground = new LGPlacedTile("ground_stock", 3000, 4000); - - - DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.LContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.LContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.LContext.SaveChanges(); - DataBaseContexts.LContext.RemoveMobFromPosition(mob.YPos, mob.XPos); - DataBaseContexts.LContext.RemoveStructureFromPosition(structure.YPos, structure.XPos); - DataBaseContexts.LContext.RemoveGroundFromPosition(ground.YPos, ground.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.RemoveMobFromPosition(mob.YPos, mob.XPos); + DataBaseContexts.LContext.RemoveStructureFromPosition(structure.YPos, structure.XPos); + DataBaseContexts.LContext.RemoveGroundFromPosition(ground.YPos, ground.XPos); + DataBaseContexts.LContext.SaveChanges(); Assert.AreEqual(null, DataBaseContexts.LContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't remove the mob correctly"); Assert.AreEqual(null, DataBaseContexts.LContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't remove the structure correctly"); Assert.AreEqual(null, DataBaseContexts.LContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't remove the ground correctly"); } - [Test] public static void SetsCorrectValues() { @@ -131,31 +119,19 @@ var ground = new LGPlacedTile("ground_stock", 3000, 4000); var newGround = new LGPlacedTile("new_ground_stock", 3000, 4000); - - - DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.LContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.LContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.LContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.LContext.SaveChanges(); - DataBaseContexts.LContext.SetMobAtPosition(newMob.stock_id, newMob.Health, newMob.YPos, newMob.XPos); - DataBaseContexts.LContext.SetStructureAtPosition(newStructure.stock_id, newStructure.Health, newStructure.YPos, newStructure.XPos); - DataBaseContexts.LContext.SetGroundAtPosition(newGround.stock_id, newGround.YPos, newGround.XPos); - DataBaseContexts.LContext.SaveChanges(); + DataBaseContexts.LContext.SetMobAtPosition(newMob.stock_id, newMob.Health, newMob.YPos, newMob.XPos); + DataBaseContexts.LContext.SetStructureAtPosition(newStructure.stock_id, newStructure.Health, newStructure.YPos, newStructure.XPos); + DataBaseContexts.LContext.SetGroundAtPosition(newGround.stock_id, newGround.YPos, newGround.XPos); + DataBaseContexts.LContext.SaveChanges(); Assert.AreEqual(newMob.stock_id, DataBaseContexts.LContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't set the mob correctly"); Assert.AreEqual(newStructure.stock_id, DataBaseContexts.LContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't set the structure correctly"); Assert.AreEqual(newGround.stock_id, DataBaseContexts.LContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't set the ground correctly"); } - - //[Test] - //public static void TruncatesTablesOnInitialization() - //{ - - - // Assert.AreEqual(0, DataBaseContexts.LContext.LMobLayer.Count(), "LMobLayer table isn't properly truncated upon LandContext initialization"); - // Assert.AreEqual(0, DataBaseContexts.LContext.LStructureLayer.Count(), "LStructureLayer table isn't properly truncated upon LandContext initialization"); - // Assert.AreEqual(0, DataBaseContexts.LContext.LGroundLayer.Count(), "LGroungLayer table isn't properly truncated upon LandContext initialization"); - //} } } diff --git a/MundusTests/DataTests/SuperLayers/SkyContextTests.cs b/MundusTests/DataTests/SuperLayers/SkyContextTests.cs index ad8771c..61c3509 100644 --- a/MundusTests/DataTests/SuperLayers/SkyContextTests.cs +++ b/MundusTests/DataTests/SuperLayers/SkyContextTests.cs @@ -2,7 +2,6 @@ { using System.Linq; using Mundus.Data; - using Mundus.Data.SuperLayers; using Mundus.Data.SuperLayers.DBTables; using NUnit.Framework; @@ -16,16 +15,14 @@ var structure = new SSPlacedTile("structure_stock", 0, 2000, 1000); var ground = new SGPlacedTile("ground_stock", 3000, 4000); - + DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.SContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.SContext.SaveChanges(); - DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.SContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.SContext.SaveChanges(); - - Assert.AreEqual(mob.stock_id, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't add the mob correctly"); - Assert.AreEqual(structure.stock_id, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't add the structure correctly"); - Assert.AreEqual(ground.stock_id, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't add the ground correctly"); + Assert.AreEqual(mob.stock_id, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't add the mob correctly"); + Assert.AreEqual(structure.stock_id, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't add the structure correctly"); + Assert.AreEqual(ground.stock_id, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't add the ground correctly"); } [Test] @@ -34,14 +31,12 @@ var mob = new SMPlacedTile("mob_stock", 10, 1000, 1001); var structure = new SSPlacedTile("structure_stock", 4, 2000, 1001); - - - DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.SContext.SaveChanges(); - Assert.IsTrue( DataBaseContexts.SContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3), "Mob is considered dead (health <= 0), but it shouldnt be"); - Assert.IsTrue( DataBaseContexts.SContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 2), "Structure is considered dead (health <= 0), but it shouldn't be"); + Assert.IsTrue(DataBaseContexts.SContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3), "Mob is considered dead (health <= 0), but it shouldnt be"); + Assert.IsTrue(DataBaseContexts.SContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 2), "Structure is considered dead (health <= 0), but it shouldn't be"); } [Test] @@ -50,14 +45,12 @@ var mob = new SMPlacedTile("mob_stock", 10, 1000, 1000); var structure = new SSPlacedTile("structure_stock", 4, 2000, 1000); - - - DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.SContext.SaveChanges(); - Assert.IsFalse( DataBaseContexts.SContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 20), "Mob is considered alive (health > 0), but it shouldnt be"); - Assert.IsFalse( DataBaseContexts.SContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 20), "Structure is considered alive (health > 0), but it shouldn't be"); + Assert.IsFalse(DataBaseContexts.SContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 20), "Mob is considered alive (health > 0), but it shouldnt be"); + Assert.IsFalse(DataBaseContexts.SContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 20), "Structure is considered alive (health > 0), but it shouldn't be"); } [Test] @@ -66,17 +59,15 @@ var mob = new SMPlacedTile("mob_stock", 10, 1000, 1002); var structure = new SSPlacedTile("structure_stock", 4, 2000, 1002); - + DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.SContext.SaveChanges(); - DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3); + DataBaseContexts.SContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1); - DataBaseContexts.SContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3); - DataBaseContexts.SContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1); - - Assert.AreEqual(7, DataBaseContexts.SContext.SMobLayer.First(x => x.YPos == mob.YPos && x.XPos == mob.XPos).Health, "Mobs recieve incorrect amount of damage"); - Assert.AreEqual(3, DataBaseContexts.SContext.SStructureLayer.First(x => x.YPos == structure.YPos && x.XPos == structure.XPos).Health, "Structures recieve incorrect amount of damage"); + Assert.AreEqual(7, DataBaseContexts.SContext.SMobLayer.First(x => x.YPos == mob.YPos && x.XPos == mob.XPos).Health, "Mobs recieve incorrect amount of damage"); + Assert.AreEqual(3, DataBaseContexts.SContext.SStructureLayer.First(x => x.YPos == structure.YPos && x.XPos == structure.XPos).Health, "Structures recieve incorrect amount of damage"); } [Test] @@ -86,16 +77,14 @@ var structure = new SSPlacedTile("structure_stock", 0, 2000, 1000); var ground = new SGPlacedTile("ground_stock", 3000, 4000); - - - DataBaseContexts.SContext.SMobLayer.Add(mob); - DataBaseContexts.SContext.SStructureLayer.Add(structure); - DataBaseContexts.SContext.SGroundLayer.Add(ground); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.SMobLayer.Add(mob); + DataBaseContexts.SContext.SStructureLayer.Add(structure); + DataBaseContexts.SContext.SGroundLayer.Add(ground); + DataBaseContexts.SContext.SaveChanges(); - Assert.AreEqual(mob.stock_id, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Doesn't get the correct mob layer stock"); - Assert.AreEqual(structure.stock_id, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Doesn't get the correct structure layer stock"); - Assert.AreEqual(ground.stock_id, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Doesn't get the correct ground layer stock"); + Assert.AreEqual(mob.stock_id, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Doesn't get the correct mob layer stock"); + Assert.AreEqual(structure.stock_id, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Doesn't get the correct structure layer stock"); + Assert.AreEqual(ground.stock_id, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Doesn't get the correct ground layer stock"); } [Test] @@ -105,24 +94,21 @@ var structure = new SSPlacedTile("structure_stock", 0, 2000, 1000); var ground = new SGPlacedTile("ground_stock", 3000, 4000); - + DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.SContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.SContext.SaveChanges(); - DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.SContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.RemoveMobFromPosition(mob.YPos, mob.XPos); + DataBaseContexts.SContext.RemoveStructureFromPosition(structure.YPos, structure.XPos); + DataBaseContexts.SContext.RemoveGroundFromPosition(ground.YPos, ground.XPos); + DataBaseContexts.SContext.SaveChanges(); - DataBaseContexts.SContext.RemoveMobFromPosition(mob.YPos, mob.XPos); - DataBaseContexts.SContext.RemoveStructureFromPosition(structure.YPos, structure.XPos); - DataBaseContexts.SContext.RemoveGroundFromPosition(ground.YPos, ground.XPos); - DataBaseContexts.SContext.SaveChanges(); - - Assert.AreEqual(null, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't remove the mob correctly"); - Assert.AreEqual(null, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't remove the structure correctly"); - Assert.AreEqual(null, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't remove the ground correctly"); + Assert.AreEqual(null, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't remove the mob correctly"); + Assert.AreEqual(null, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't remove the structure correctly"); + Assert.AreEqual(null, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't remove the ground correctly"); } - [Test] public static void SetsCorrectValues() { @@ -133,31 +119,19 @@ var ground = new SGPlacedTile("ground_stock", 3000, 4000); var newGround = new SGPlacedTile("new_ground_stock", 3000, 4000); - - - DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.SContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.SContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.SContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.SContext.SaveChanges(); - DataBaseContexts.SContext.SetMobAtPosition(newMob.stock_id, newMob.Health, newMob.YPos, newMob.XPos); - DataBaseContexts.SContext.SetStructureAtPosition(newStructure.stock_id, newStructure.Health, newStructure.YPos, newStructure.XPos); - DataBaseContexts.SContext.SetGroundAtPosition(newGround.stock_id, newGround.YPos, newGround.XPos); - DataBaseContexts.SContext.SaveChanges(); + DataBaseContexts.SContext.SetMobAtPosition(newMob.stock_id, newMob.Health, newMob.YPos, newMob.XPos); + DataBaseContexts.SContext.SetStructureAtPosition(newStructure.stock_id, newStructure.Health, newStructure.YPos, newStructure.XPos); + DataBaseContexts.SContext.SetGroundAtPosition(newGround.stock_id, newGround.YPos, newGround.XPos); + DataBaseContexts.SContext.SaveChanges(); - Assert.AreEqual(newMob.stock_id, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't set the mob correctly"); - Assert.AreEqual(newStructure.stock_id, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't set the structure correctly"); - Assert.AreEqual(newGround.stock_id, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't set the ground correctly"); + Assert.AreEqual(newMob.stock_id, DataBaseContexts.SContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't set the mob correctly"); + Assert.AreEqual(newStructure.stock_id, DataBaseContexts.SContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't set the structure correctly"); + Assert.AreEqual(newGround.stock_id, DataBaseContexts.SContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't set the ground correctly"); } - - //[Test] - //public static void TruncatesTablesOnInitialization() - //{ - - - // Assert.AreEqual(0, DataBaseContexts.SContext.SMobLayer.Count(), "SMobLayer table isn't properly truncated upon SkyContext initialization"); - // Assert.AreEqual(0, DataBaseContexts.SContext.SStructureLayer.Count(), "SStructureLayer table isn't properly truncated upon SkyContext initialization"); - // Assert.AreEqual(0, DataBaseContexts.SContext.SGroundLayer.Count(), "LGroungLayer table isn't properly truncated upon SkyContext initialization"); - //} } } diff --git a/MundusTests/DataTests/SuperLayers/UndergroundContextTests.cs b/MundusTests/DataTests/SuperLayers/UndergroundContextTests.cs index 0cf938f..ad3c0c6 100644 --- a/MundusTests/DataTests/SuperLayers/UndergroundContextTests.cs +++ b/MundusTests/DataTests/SuperLayers/UndergroundContextTests.cs @@ -2,7 +2,6 @@ { using System.Linq; using Mundus.Data; - using Mundus.Data.SuperLayers; using Mundus.Data.SuperLayers.DBTables; using NUnit.Framework; @@ -14,18 +13,16 @@ { var mob = new UMPlacedTile("mob_stock", 0, 1000, 1000); var structure = new USPlacedTile("structure_stock", 0, 2000, 1000); - var ground = new UGPlacedTile("ground_stock", 3000, 4000); - - + var ground = new UGPlacedTile("ground_stock", 3000, 4000); - DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.UContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.UContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.UContext.SaveChanges(); - Assert.AreEqual(mob.stock_id, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't add the mob correctly"); - Assert.AreEqual(structure.stock_id, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't add the structure correctly"); - Assert.AreEqual(ground.stock_id, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't add the ground correctly"); + Assert.AreEqual(mob.stock_id, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't add the mob correctly"); + Assert.AreEqual(structure.stock_id, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't add the structure correctly"); + Assert.AreEqual(ground.stock_id, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't add the ground correctly"); } [Test] @@ -34,14 +31,12 @@ var mob = new UMPlacedTile("mob_stock", 10, 1000, 1001); var structure = new USPlacedTile("structure_stock", 4, 2000, 1001); - - - DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.UContext.SaveChanges(); - Assert.IsTrue( DataBaseContexts.UContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3), "Mob is considered dead (health <= 0), but it shouldnt be"); - Assert.IsTrue( DataBaseContexts.UContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 2), "Structure is considered dead (health <= 0), but it shouldn't be"); + Assert.IsTrue(DataBaseContexts.UContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3), "Mob is considered dead (health <= 0), but it shouldnt be"); + Assert.IsTrue(DataBaseContexts.UContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 2), "Structure is considered dead (health <= 0), but it shouldn't be"); } [Test] @@ -50,14 +45,12 @@ var mob = new UMPlacedTile("mob_stock", 10, 1000, 1000); var structure = new USPlacedTile("structure_stock", 4, 2000, 1000); - + DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.UContext.SaveChanges(); - DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.UContext.SaveChanges(); - - Assert.IsFalse( DataBaseContexts.UContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 20), "Mob is considered alive (health > 0), but it shouldnt be"); - Assert.IsFalse( DataBaseContexts.UContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 20), "Structure is considered alive (health > 0), but it shouldn't be"); + Assert.IsFalse(DataBaseContexts.UContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 20), "Mob is considered alive (health > 0), but it shouldnt be"); + Assert.IsFalse(DataBaseContexts.UContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 20), "Structure is considered alive (health > 0), but it shouldn't be"); } [Test] @@ -66,17 +59,15 @@ var mob = new UMPlacedTile("mob_stock", 10, 1000, 1002); var structure = new USPlacedTile("structure_stock", 4, 2000, 1002); - - - DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.UContext.SaveChanges(); - DataBaseContexts.UContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3); - DataBaseContexts.UContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1); + DataBaseContexts.UContext.TakeDamageMobAtPosition(mob.YPos, mob.XPos, 3); + DataBaseContexts.UContext.TakeDamageStructureAtPosition(structure.YPos, structure.XPos, 1); - Assert.AreEqual(7, DataBaseContexts.UContext.UMobLayer.First(x => x.YPos == mob.YPos && x.XPos == mob.XPos).Health, "Mobs recieve incorrect amount of damage"); - Assert.AreEqual(3, DataBaseContexts.UContext.UStructureLayer.First(x => x.YPos == structure.YPos && x.XPos == structure.XPos).Health, "Structures recieve incorrect amount of damage"); + Assert.AreEqual(7, DataBaseContexts.UContext.UMobLayer.First(x => x.YPos == mob.YPos && x.XPos == mob.XPos).Health, "Mobs recieve incorrect amount of damage"); + Assert.AreEqual(3, DataBaseContexts.UContext.UStructureLayer.First(x => x.YPos == structure.YPos && x.XPos == structure.XPos).Health, "Structures recieve incorrect amount of damage"); } [Test] @@ -86,16 +77,14 @@ var structure = new USPlacedTile("structure_stock", 0, 2000, 1000); var ground = new UGPlacedTile("ground_stock", 3000, 4000); - - - DataBaseContexts.UContext.UMobLayer.Add(mob); - DataBaseContexts.UContext.UStructureLayer.Add(structure); - DataBaseContexts.UContext.UGroundLayer.Add(ground); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.UMobLayer.Add(mob); + DataBaseContexts.UContext.UStructureLayer.Add(structure); + DataBaseContexts.UContext.UGroundLayer.Add(ground); + DataBaseContexts.UContext.SaveChanges(); - Assert.AreEqual(mob.stock_id, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Doesn't get the correct mob layer stock"); - Assert.AreEqual(structure.stock_id, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Doesn't get the correct structure layer stock"); - Assert.AreEqual(ground.stock_id, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Doesn't get the correct ground layer stock"); + Assert.AreEqual(mob.stock_id, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Doesn't get the correct mob layer stock"); + Assert.AreEqual(structure.stock_id, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Doesn't get the correct structure layer stock"); + Assert.AreEqual(ground.stock_id, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Doesn't get the correct ground layer stock"); } [Test] @@ -105,24 +94,21 @@ var structure = new USPlacedTile("structure_stock", 0, 2000, 1000); var ground = new UGPlacedTile("ground_stock", 3000, 4000); - + DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.UContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.UContext.SaveChanges(); - DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.UContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.RemoveMobFromPosition(mob.YPos, mob.XPos); + DataBaseContexts.UContext.RemoveStructureFromPosition(structure.YPos, structure.XPos); + DataBaseContexts.UContext.RemoveGroundFromPosition(ground.YPos, ground.XPos); + DataBaseContexts.UContext.SaveChanges(); - DataBaseContexts.UContext.RemoveMobFromPosition(mob.YPos, mob.XPos); - DataBaseContexts.UContext.RemoveStructureFromPosition(structure.YPos, structure.XPos); - DataBaseContexts.UContext.RemoveGroundFromPosition(ground.YPos, ground.XPos); - DataBaseContexts.UContext.SaveChanges(); - - Assert.AreEqual(null, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't remove the mob correctly"); - Assert.AreEqual(null, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't remove the structure correctly"); - Assert.AreEqual(null, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't remove the ground correctly"); + Assert.AreEqual(null, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't remove the mob correctly"); + Assert.AreEqual(null, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't remove the structure correctly"); + Assert.AreEqual(null, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't remove the ground correctly"); } - [Test] public static void SetsCorrectValues() { @@ -133,31 +119,19 @@ var ground = new UGPlacedTile("ground_stock", 3000, 4000); var newGround = new UGPlacedTile("new_ground_stock", 3000, 4000); - - - DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); - DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); - DataBaseContexts.UContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.AddMobAtPosition(mob.stock_id, mob.Health, mob.YPos, mob.XPos); + DataBaseContexts.UContext.AddStructureAtPosition(structure.stock_id, structure.Health, structure.YPos, structure.XPos); + DataBaseContexts.UContext.AddGroundAtPosition(ground.stock_id, ground.YPos, ground.XPos); + DataBaseContexts.UContext.SaveChanges(); - DataBaseContexts.UContext.SetMobAtPosition(newMob.stock_id, newMob.Health, newMob.YPos, newMob.XPos); - DataBaseContexts.UContext.SetStructureAtPosition(newStructure.stock_id, newStructure.Health, newStructure.YPos, newStructure.XPos); - DataBaseContexts.UContext.SetGroundAtPosition(newGround.stock_id, newGround.YPos, newGround.XPos); - DataBaseContexts.UContext.SaveChanges(); + DataBaseContexts.UContext.SetMobAtPosition(newMob.stock_id, newMob.Health, newMob.YPos, newMob.XPos); + DataBaseContexts.UContext.SetStructureAtPosition(newStructure.stock_id, newStructure.Health, newStructure.YPos, newStructure.XPos); + DataBaseContexts.UContext.SetGroundAtPosition(newGround.stock_id, newGround.YPos, newGround.XPos); + DataBaseContexts.UContext.SaveChanges(); - Assert.AreEqual(newMob.stock_id, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't set the mob correctly"); - Assert.AreEqual(newStructure.stock_id, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't set the structure correctly"); - Assert.AreEqual(newGround.stock_id, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't set the ground correctly"); + Assert.AreEqual(newMob.stock_id, DataBaseContexts.UContext.GetMobLayerStock(mob.YPos, mob.XPos), "Didn't set the mob correctly"); + Assert.AreEqual(newStructure.stock_id, DataBaseContexts.UContext.GetStructureLayerStock(structure.YPos, structure.XPos), "Didn't set the structure correctly"); + Assert.AreEqual(newGround.stock_id, DataBaseContexts.UContext.GetGroundLayerStock(ground.YPos, ground.XPos), "Didn't set the ground correctly"); } - - //[Test] - //public static void TruncatesTablesOnInitialization() - //{ - - - // Assert.AreEqual(0, DataBaseContexts.UContext.UMobLayer.Count(), "UMobLayer table isn't properly truncated upon UndergroundContext initialization"); - // Assert.AreEqual(0, DataBaseContexts.UContext.UStructureLayer.Count(), "UStructureLayer table isn't properly truncated upon UndergroundContext initialization"); - // Assert.AreEqual(0, DataBaseContexts.UContext.UGroundLayer.Count(), "LGroungLayer table isn't properly truncated upon UndergroundContext initialization"); - //} } } diff --git a/MundusTests/MundusTests.csproj b/MundusTests/MundusTests.csproj index bb185b7..dd6be8d 100644 --- a/MundusTests/MundusTests.csproj +++ b/MundusTests/MundusTests.csproj @@ -131,7 +131,7 @@ <HintPath>..\packages\BouncyCastle.1.8.6.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.12.0\lib\net45\Google.Protobuf.dll</HintPath>
+ <HintPath>..\packages\Google.Protobuf.3.12.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet">
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
@@ -199,6 +199,7 @@ <Compile Include="ServiceTests\Tiles\Mobs\InventoryTests.cs" />
<Compile Include="ApplicationSetup.cs" />
<Compile Include="ServiceTests\Tiles\Mobs\MobTileTests.cs" />
+ <Compile Include="ServiceTests\GameEventLogControllerTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
diff --git a/MundusTests/ServiceTests/GameEventLogControllerTests.cs b/MundusTests/ServiceTests/GameEventLogControllerTests.cs new file mode 100644 index 0000000..bed1ef9 --- /dev/null +++ b/MundusTests/ServiceTests/GameEventLogControllerTests.cs @@ -0,0 +1,35 @@ +namespace MundusTests.ServiceTests +{ + using System.Linq; + using Mundus.Data; + using Mundus.Service; + using NUnit.Framework; + + [TestFixture] + public static class GameEventLogControllerTests + { + [Test] + [TestCase("Testing")] + public static void AddsCorrectlyMessages(string message) + { + GameEventLogController.AddMessage(message); + + Assert.AreEqual(message, DataBaseContexts.GELContext.GameEventLogs.Single(x => x.ID == DataBaseContexts.GELContext.GameEventLogs.Count()).Message); + } + + [Test] + [TestCase("Testing1")] + public static void GetsCorrectlyMessage(string message) + { + GameEventLogController.AddMessage(message); + + Assert.AreEqual(message, GameEventLogController.GetMessagage(GameEventLogController.GetCount() - 1)); + } + + [Test] + public static void GetsCorrectCount() + { + Assert.AreEqual(DataBaseContexts.GELContext.GetCount(), GameEventLogController.GetCount()); + } + } +} diff --git a/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs b/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs index 9ab6418..248adbe 100644 --- a/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs +++ b/MundusTests/ServiceTests/SuperLayers/ImageControllerTests.cs @@ -3,7 +3,6 @@ using Gtk; using Mundus.Data; using Mundus.Data.Tiles.Mobs; - using Mundus.Data.Windows; using Mundus.Service.SuperLayers; using NUnit.Framework; using static Mundus.Service.SuperLayers.ImageController; @@ -12,7 +11,6 @@ [TestFixture] public static class ImageControllerTests { - [Test] [TestCase(1, 5)] [TestCase(2, 2)] @@ -67,14 +65,17 @@ { Image img = null; - if (DataBaseContexts.LContext.GetStructureLayerStock(yPos, xPos) != null) { + if (DataBaseContexts.LContext.GetStructureLayerStock(yPos, xPos) != null) + { img = new Image(DataBaseContexts.LContext.GetStructureLayerStock(yPos, xPos), IconSize.Dnd); } - if (img == null) { + if (img == null) + { Assert.AreEqual(img, ImageController.GetPlayerScreenImage(yPos, xPos, Layer.Structure), $"Structure image at Y:{yPos}, X:{xPos} should be null"); } - else { + else + { Assert.AreEqual(img.Stock, ImageController.GetPlayerScreenImage(yPos, xPos, Layer.Structure).Stock, $"Structure image at Y:{yPos}, X:{xPos} should be {img.Stock}, but is {ImageController.GetPlayerScreenImage(yPos, xPos, Layer.Ground).Stock}"); } } @@ -115,7 +116,8 @@ [TestCase(0)] [TestCase(1)] [TestCase(2)] - public static void GetsCorrectPlayerAccessoriesImage(int index) { + public static void GetsCorrectPlayerAccessoriesImage(int index) + { Image img = new Image("blank_gear", IconSize.Dnd); if (MI.Player.Inventory.Accessories[index] != null) diff --git a/MundusTests/ServiceTests/Tiles/Crafting/CraftingControllerTests.cs b/MundusTests/ServiceTests/Tiles/Crafting/CraftingControllerTests.cs index e0cd66d..5961c72 100644 --- a/MundusTests/ServiceTests/Tiles/Crafting/CraftingControllerTests.cs +++ b/MundusTests/ServiceTests/Tiles/Crafting/CraftingControllerTests.cs @@ -1,11 +1,9 @@ namespace MundusTests.ServiceTests.Tiles.Crafting { using System.Linq; - using Gtk; using Mundus.Data; using Mundus.Data.Tiles.Mobs; using Mundus.Data.Tiles.Presets; - using Mundus.Data.Windows; using Mundus.Service.Tiles.Crafting; using NUnit.Framework; @@ -17,10 +15,11 @@ { var recipe = DataBaseContexts.CTContext.CraftingRecipes.First(x => x.ResultItem == "wooden_shovel"); - for(int i = 0; i < recipe.Count1; i++) + for (int i = 0; i < recipe.Count1; i++) { MI.Player.Inventory.AppendToItems(MaterialPresets.GetALandStick()); } + CraftingController.CraftItemPlayer(recipe); Assert.Contains(recipe.ResultItem, MI.Player.Inventory.Items.Where(x => x != null).Select(x => x.stock_id).ToArray(), "Result item isn't added to player's inventory"); diff --git a/MundusTests/ServiceTests/Tiles/Items/ItemControllerTests.cs b/MundusTests/ServiceTests/Tiles/Items/ItemControllerTests.cs index 497ccf3..a399e04 100644 --- a/MundusTests/ServiceTests/Tiles/Items/ItemControllerTests.cs +++ b/MundusTests/ServiceTests/Tiles/Items/ItemControllerTests.cs @@ -1,19 +1,18 @@ -using System; -using Mundus.Data; -using NUnit.Framework; -using Gtk; -using Mundus.Data.Windows; -using static Mundus.Service.Tiles.Mobs.Inventory; -using Mundus.Service.Tiles.Items; -using Mundus.Service.Tiles.Mobs; +namespace MundusTests.ServiceTests.Tiles.Items +{ + using Mundus.Service.Tiles.Items; + using Mundus.Service.Tiles.Mobs; + using NUnit.Framework; + using static Mundus.Service.Tiles.Mobs.Inventory; -namespace MundusTests.ServiceTests.Tiles.Items { [TestFixture] - public static class ItemControllerTests { + public static class ItemControllerTests + { [Test] [TestCase(InventoryPlace.Accessories, 1)] [TestCase(InventoryPlace.Hotbar, 4)] - public static void SelectsItemProperly(InventoryPlace place, int index) { + public static void SelectsItemProperly(InventoryPlace place, int index) + { ItemController.SelectItem(place, index); Assert.AreEqual(place, ItemController.SelItemPlace, "Item place isn't set correctly"); @@ -22,7 +21,8 @@ namespace MundusTests.ServiceTests.Tiles.Items { [Test] [TestCase(InventoryPlace.Hotbar, 1, InventoryPlace.Items, 1)] - public static void SwitchesDifferentItemsProperly(InventoryPlace origin, int originIndex, InventoryPlace destination, int destinationIndex) { + public static void SwitchesDifferentItemsProperly(InventoryPlace origin, int originIndex, InventoryPlace destination, int destinationIndex) + { ItemController.SelectItem(destination, destinationIndex); var destinationItem = Inventory.GetPlayerItemFromItemSelection(); @@ -32,18 +32,22 @@ namespace MundusTests.ServiceTests.Tiles.Items { ItemController.SwitchItems(destination, destinationIndex); ItemController.SelectItem(origin, originIndex); - if (Inventory.GetPlayerItemFromItemSelection() != null) { + if (Inventory.GetPlayerItemFromItemSelection() != null) + { Assert.AreEqual(destinationItem.stock_id, Inventory.GetPlayerItemFromItemSelection().stock_id); } - else { + else + { Assert.Pass(); } ItemController.SelectItem(destination, destinationIndex); - if (Inventory.GetPlayerItemFromItemSelection() != null) { + if (Inventory.GetPlayerItemFromItemSelection() != null) + { Assert.AreEqual(originItem.stock_id, Inventory.GetPlayerItemFromItemSelection()); } - else { + else + { Assert.Pass(); } } diff --git a/MundusTests/ServiceTests/Tiles/Items/Types/StructureTests.cs b/MundusTests/ServiceTests/Tiles/Items/Types/StructureTests.cs index 0a18a1b..dd9b80b 100644 --- a/MundusTests/ServiceTests/Tiles/Items/Types/StructureTests.cs +++ b/MundusTests/ServiceTests/Tiles/Items/Types/StructureTests.cs @@ -12,7 +12,7 @@ [TestCase("test")] public static void InstantiatesFromStock(string stock_id) { - Structure gt = new Structure(stock_id, "", 0, ToolType.Axe, 0); + Structure gt = new Structure(stock_id, string.Empty, 0, ToolType.Axe, 0); Assert.AreEqual(stock_id, gt.stock_id, "Structure doesn't set stock_id properly"); } @@ -20,7 +20,7 @@ [Test] public static void InstantiatesFromAnotherStructure() { - Structure gt = new Structure("testing", "", 0, ToolType.Axe, 0); + Structure gt = new Structure("testing", string.Empty, 0, ToolType.Axe, 0); Structure gt1 = new Structure(gt); Assert.AreEqual(gt.stock_id, gt1.stock_id, "Structure constructor doesn't work properly with a groundtile as a parameter"); diff --git a/MundusTests/ServiceTests/Tiles/Mobs/InventoryTests.cs b/MundusTests/ServiceTests/Tiles/Mobs/InventoryTests.cs index 9f0d687..567bb29 100644 --- a/MundusTests/ServiceTests/Tiles/Mobs/InventoryTests.cs +++ b/MundusTests/ServiceTests/Tiles/Mobs/InventoryTests.cs @@ -1,17 +1,18 @@ -using System; -using Mundus.Service.Tiles.Items; -using Mundus.Service.Tiles.Items.Types; -using Mundus.Service.Tiles.Mobs; -using NUnit.Framework; +namespace MundusTests.ServiceTests.Tiles.Mobs +{ + using Mundus.Service.Tiles.Items.Types; + using Mundus.Service.Tiles.Mobs; + using NUnit.Framework; -namespace MundusTests.ServiceTests.Tiles.Mobs { [TestFixture] - public static class InventoryTests { + public static class InventoryTests + { [Test] [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AddsToHotbar(string stock_id1, string stock_id2) { + public static void AddsToHotbar(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToHotbar(new Material(stock_id1), 2); @@ -25,7 +26,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AddsToItems(string stock_id1, string stock_id2) { + public static void AddsToItems(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToItems(new Material(stock_id1), 2); @@ -39,7 +41,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AddsToAccessories(string stock_id1, string stock_id2) { + public static void AddsToAccessories(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToAccessories(new Gear(stock_id1), 2); @@ -53,7 +56,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AddsToGear(string stock_id1, string stock_id2) { + public static void AddsToGear(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToGear(new Gear(stock_id1), 2); @@ -67,7 +71,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AppendsToHotbar(string stock_id1, string stock_id2) { + public static void AppendsToHotbar(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AppendToHotbar(new Material(stock_id1)); @@ -81,7 +86,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AppendsToItems(string stock_id1, string stock_id2) { + public static void AppendsToItems(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AppendToItems(new Material(stock_id1)); @@ -95,7 +101,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AppendsToAccessories(string stock_id1, string stock_id2) { + public static void AppendsToAccessories(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AppendToAccessories(new Gear(stock_id1)); @@ -109,7 +116,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void AppendsToGear(string stock_id1, string stock_id2) { + public static void AppendsToGear(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AppendToGear(new Gear(stock_id1)); @@ -119,12 +127,12 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { Assert.AreEqual(stock_id2, inv.Gear[1].stock_id, "Append to gear doesn't work as expected"); } - [Test] [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void DeletesFromHotbar(string stock_id1, string stock_id2) { + public static void DeletesFromHotbar(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToHotbar(new Gear(stock_id1), 2); @@ -141,7 +149,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void DeletesFromItems(string stock_id1, string stock_id2) { + public static void DeletesFromItems(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToItems(new Gear(stock_id1), 2); @@ -158,7 +167,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void DeletesFromAccessories(string stock_id1, string stock_id2) { + public static void DeletesFromAccessories(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToAccessories(new Gear(stock_id1), 2); @@ -175,7 +185,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", "two")] [TestCase(null, "two")] [TestCase("", "two")] - public static void DeletesFromGear(string stock_id1, string stock_id2) { + public static void DeletesFromGear(string stock_id1, string stock_id2) + { Inventory inv = new Inventory(5); inv.AddToGear(new Gear(stock_id1), 2); @@ -192,7 +203,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase(1)] [TestCase(5)] [TestCase(10)] - public static void InstantiatesProperly(int size) { + public static void InstantiatesProperly(int size) + { Inventory inv = new Inventory(size); Assert.AreEqual(size, inv.Hotbar.Length, "Hotbar has incorrect size"); @@ -205,7 +217,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", 3)] [TestCase(null, 1)] [TestCase("", 4)] - public static void GetsProperHotbarItemTile(string stock_id, int index) { + public static void GetsProperHotbarItemTile(string stock_id, int index) + { Inventory inv = new Inventory(5); inv.AddToHotbar(new Material(stock_id), index); @@ -217,7 +230,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", 3)] [TestCase(null, 1)] [TestCase("", 4)] - public static void GetsProperItemsItemTile(string stock_id, int index) { + public static void GetsProperItemsItemTile(string stock_id, int index) + { Inventory inv = new Inventory(5); inv.AddToItems(new Material(stock_id), index); @@ -229,7 +243,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", 3)] [TestCase(null, 1)] [TestCase("", 4)] - public static void GetsProperAccessoriesItemTile(string stock_id, int index) { + public static void GetsProperAccessoriesItemTile(string stock_id, int index) + { Inventory inv = new Inventory(5); inv.AddToAccessories(new Gear(stock_id), index); @@ -241,7 +256,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [TestCase("one", 3)] [TestCase(null, 1)] [TestCase("", 4)] - public static void GetsProperGearItemTile(string stock_id, int index) { + public static void GetsProperGearItemTile(string stock_id, int index) + { Inventory inv = new Inventory(5); inv.AddToGear(new Gear(stock_id), index); diff --git a/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs b/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs index b91877c..a4329dc 100644 --- a/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs +++ b/MundusTests/ServiceTests/Tiles/Mobs/MobTileTests.cs @@ -1,15 +1,17 @@ -using System; -using Mundus.Data; -using Mundus.Data.Windows; -using Mundus.Service.Tiles.Items.Types; -using Mundus.Service.Tiles.Mobs; -using NUnit.Framework; - -namespace MundusTests.ServiceTests.Tiles.Mobs { +namespace MundusTests.ServiceTests.Tiles.Mobs +{ + using Mundus.Data; + using Mundus.Data.Windows; + using Mundus.Service.Tiles.Items.Types; + using Mundus.Service.Tiles.Mobs; + using NUnit.Framework; + [TestFixture] - public static class MobTileTests { + public static class MobTileTests + { [Test] - public static void InstantiatesProperly() { + public static void InstantiatesProperly() + { MobTile mob = new MobTile("test", 10, 3, DataBaseContexts.SContext, 7, new Material("test_material"), 9); Assert.AreEqual("test", mob.stock_id); @@ -24,7 +26,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [Test] [TestCase(10, 3)] [TestCase(19, 11)] - public static void AliveAfterTakingSmallDamage(int health, int damage) { + public static void AliveAfterTakingSmallDamage(int health, int damage) + { MobTile mob = new MobTile("test", health, 3, DataBaseContexts.SContext); Assert.IsTrue(mob.TakeDamage(damage)); @@ -33,7 +36,8 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [Test] [TestCase(10, 10)] [TestCase(13, 20)] - public static void DeadAfterTakingBigDamage(int health, int damage) { + public static void DeadAfterTakingBigDamage(int health, int damage) + { MobTile mob = new MobTile("test", health, 3, DataBaseContexts.SContext); Assert.IsFalse(mob.TakeDamage(damage)); @@ -42,19 +46,20 @@ namespace MundusTests.ServiceTests.Tiles.Mobs { [Test] [TestCase(10, 10)] [TestCase(13, 20)] - public static void HealsProperly(int health, int healByPoints) { + public static void HealsProperly(int health, int healByPoints) + { MobTile mob = new MobTile("test", health, 3, DataBaseContexts.SContext); mob.Heal(healByPoints); - if (health + healByPoints > WI.SelWin.Size * 4) { + if (health + healByPoints > WI.SelWin.Size * 4) + { Assert.AreEqual(WI.SelWin.Size, mob.Health); } - else { - + else + { Assert.AreEqual(health + healByPoints, mob.Health); } - } } } diff --git a/MundusTests/packages.config b/MundusTests/packages.config index 348b94a..2701787 100644 --- a/MundusTests/packages.config +++ b/MundusTests/packages.config @@ -6,7 +6,7 @@ <package id="GdkSharp" version="3.22.25.74" targetFramework="net47" /> <package id="GioSharp" version="3.22.25.74" targetFramework="net47" /> <package id="GLibSharp" version="3.22.25.74" targetFramework="net47" /> - <package id="Google.Protobuf" version="3.12.0" targetFramework="net47" /> + <package id="Google.Protobuf" version="3.12.1" targetFramework="net47" /> <package id="K4os.Compression.LZ4" version="1.1.11" targetFramework="net47" /> <package id="K4os.Compression.LZ4.Streams" version="1.1.11" targetFramework="net47" /> <package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net47" /> |
