Skip to content

Commit

Permalink
Starting explicit assembly names
Browse files Browse the repository at this point in the history
  • Loading branch information
cidthecoatrack committed Jul 2, 2024
1 parent c93f229 commit a734bd7
Show file tree
Hide file tree
Showing 42 changed files with 301 additions and 278 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DnDGen.Stress" Version="3.5.0" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="DnDGen.Stress" Version="3.5.1" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DnDGen.Infrastructure" Version="4.4.2" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="DnDGen.Infrastructure" Version="5.0.0" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DnDGen.Infrastructure" Version="4.4.2" />
<PackageReference Include="DnDGen.RollGen" Version="15.5.4" />
<PackageReference Include="DnDGen.Infrastructure" Version="5.0.0" />
<PackageReference Include="DnDGen.RollGen" Version="15.5.7" />
<PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions DnDGen.TreasureGen.Tests.Unit/ConfigTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using NUnit.Framework;

namespace DnDGen.TreasureGen.Tests.Unit
{
internal class ConfigTests
{
[Test]
public void ConfigNameIsCorrect()
{
var configType = typeof(Config);
Assert.That(Config.Name, Is.EqualTo("DnDGen.TreasureGen").And.EqualTo(configType.Namespace));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

<ItemGroup>
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void Setup()
var count = 0;
object testLock = new object();
mockCollectionsSelector
.Setup(p => p.SelectRandomFrom(tableName, It.IsAny<string>()))
.Setup(p => p.SelectRandomFrom(Config.Name, tableName, It.IsAny<string>()))
.Returns(() =>
{
lock (testLock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Setup()
selection.Type = "power";
selection.Amount = 42;
mockTypeAndAmountPercentileSelector.Setup(p => p.SelectFrom(It.IsAny<string>())).Returns(selection);
mockPercentileSelector.Setup(p => p.SelectFrom(It.IsAny<string>())).Returns(ItemTypeConstants.WondrousItem);
mockPercentileSelector.Setup(p => p.SelectFrom(Config.Name, It.IsAny<string>())).Returns(ItemTypeConstants.WondrousItem);

var dummyMagicalMock = new Mock<MagicalItemGenerator>();
dummyMagicalMock.Setup(m => m.GenerateRandom(It.IsAny<string>())).Returns(() => new Item { Name = "magical item" });
Expand Down Expand Up @@ -139,7 +139,7 @@ public void GenerateRandomAtLevel_GetMundaneItems()

var mundaneItem = new Item();
var expectedTableName = string.Format(TableNameConstants.Percentiles.Formattable.POWERItems, selection.Type);
mockPercentileSelector.Setup(p => p.SelectFrom(expectedTableName)).Returns("mundane item type");
mockPercentileSelector.Setup(p => p.SelectFrom(Config.Name, expectedTableName)).Returns("mundane item type");
mockJustInTimeFactory.Setup(f => f.Build<MundaneItemGenerator>("mundane item type")).Returns(mockMundaneItemGenerator.Object);
mockMundaneItemGenerator.Setup(g => g.GenerateRandom()).Returns(mundaneItem);

Expand All @@ -155,7 +155,7 @@ public void GenerateRandomAtLevel_GetMagicalItems()

var magicalItem = new Item();
var expectedTableName = string.Format(TableNameConstants.Percentiles.Formattable.POWERItems, selection.Type);
mockPercentileSelector.Setup(p => p.SelectFrom(expectedTableName)).Returns("magic item type");
mockPercentileSelector.Setup(p => p.SelectFrom(Config.Name, expectedTableName)).Returns("magic item type");
mockJustInTimeFactory.Setup(f => f.Build<MagicalItemGenerator>("magic item type")).Returns(mockMagicalItemGenerator.Object);
mockMagicalItemGenerator.Setup(g => g.GenerateRandom(selection.Type)).Returns(magicalItem);

Expand Down Expand Up @@ -223,7 +223,7 @@ public async Task GenerateRandomAtLevelAsync_GetMundaneItems()

var mundaneItem = new Item();
var expectedTableName = string.Format(TableNameConstants.Percentiles.Formattable.POWERItems, selection.Type);
mockPercentileSelector.Setup(p => p.SelectFrom(expectedTableName)).Returns("mundane item type");
mockPercentileSelector.Setup(p => p.SelectFrom(Config.Name, expectedTableName)).Returns("mundane item type");
mockJustInTimeFactory.Setup(f => f.Build<MundaneItemGenerator>("mundane item type")).Returns(mockMundaneItemGenerator.Object);
mockMundaneItemGenerator.Setup(g => g.GenerateRandom()).Returns(mundaneItem);

Expand All @@ -239,7 +239,7 @@ public async Task GenerateRandomAtLevelAsync_GetMagicalItems()

var magicalItem = new Item();
var expectedTableName = string.Format(TableNameConstants.Percentiles.Formattable.POWERItems, selection.Type);
mockPercentileSelector.Setup(p => p.SelectFrom(expectedTableName)).Returns("magic item type");
mockPercentileSelector.Setup(p => p.SelectFrom(Config.Name, expectedTableName)).Returns("magic item type");
mockJustInTimeFactory.Setup(f => f.Build<MagicalItemGenerator>("magic item type")).Returns(mockMagicalItemGenerator.Object);
mockMagicalItemGenerator.Setup(g => g.GenerateRandom(selection.Type)).Returns(magicalItem);

Expand All @@ -253,7 +253,7 @@ public void GenerateAtLevel_Named_GetMundaneItem()
selection.Type = PowerConstants.Mundane;

mockCollectionSelector
.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Setup(s => s.SelectFrom(Config.Name, TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Returns(new[] { PowerConstants.Mundane, "power", "more power", "wrong power" });

var firstItem = new Item();
Expand All @@ -270,7 +270,7 @@ public void BUG_GenerateAtLevel_Named_GetMundaneItem_WhenNoPowerSpecified()
selection.Type = string.Empty;

mockCollectionSelector
.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Setup(s => s.SelectFrom(Config.Name, TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Returns(new[] { PowerConstants.Mundane, "power", "more power", "wrong power" });

var firstItem = new Item();
Expand All @@ -287,7 +287,7 @@ public void BUG_GenerateAtLevel_Named_GetSpecificItem_WhenMundaneSpecified()
selection.Type = PowerConstants.Mundane;

mockCollectionSelector
.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.PowerGroups, "specific item"))
.Setup(s => s.SelectFrom(Config.Name, TableNameConstants.Collections.Set.PowerGroups, "specific item"))
.Returns(new[] { "power", "more power", "wrong power" });

var magicalItem = new Item();
Expand All @@ -304,7 +304,7 @@ public void BUG_GenerateAtLevel_Named_GetSpecificItem_WhenNoneSpecified()
selection.Type = string.Empty;

mockCollectionSelector
.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.PowerGroups, "specific item"))
.Setup(s => s.SelectFrom(Config.Name, TableNameConstants.Collections.Set.PowerGroups, "specific item"))
.Returns(new[] { "power", "more power", "wrong power" });

var magicalItem = new Item();
Expand All @@ -321,7 +321,7 @@ public void BUG_GenerateAtLevel_Named_GetMagicalItem_WhenNoPowerSpecified()
selection.Type = string.Empty;

mockCollectionSelector
.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Setup(s => s.SelectFrom(Config.Name, TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Returns(new[] { "power", "more power", "wrong power" });

var magicalItem = new Item();
Expand All @@ -338,7 +338,7 @@ public void BUG_GenerateAtLevel_Named_GetMundaneItem_WhenPowerIsMagical_ButItemT
selection.Type = "power";

mockCollectionSelector
.Setup(s => s.SelectFrom(TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Setup(s => s.SelectFrom(Config.Name, TableNameConstants.Collections.Set.PowerGroups, "item name"))
.Returns(new[] { PowerConstants.Mundane });

var firstItem = new Item();
Expand Down
Loading

0 comments on commit a734bd7

Please sign in to comment.