Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/dependabot.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="nunit" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="nunit" Version="4.6.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DnDGen.RollGen.Tests.Integration\DnDGen.RollGen.Tests.Integration.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void RandomIsCreatedAsSingleton()
[Test]
public void CannotInjectPartialRoll()
{
Assert.That(() => GetNewInstanceOf<PartialRoll>(), Throws.InstanceOf<ActivationException>());
Assert.That((Func<object>)(() => GetNewInstanceOf<PartialRoll>()), Throws.InstanceOf<ActivationException>());
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DnDGen.Stress" Version="4.1.3" />
<PackageReference Include="DnDGen.Stress" Version="4.1.5" />
<PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="nunit" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="nunit" Version="4.6.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DnDGen.RollGen.Tests.Integration\DnDGen.RollGen.Tests.Integration.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="nunit" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="nunit" Version="4.6.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DnDGen.RollGen\DnDGen.RollGen.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions DnDGen.RollGen.Tests.Unit/DnDGen.RollGen.Tests.Unit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="nunit" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="nunit" Version="4.6.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DnDGen.RollGen\DnDGen.RollGen.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void EvaluateDouble()
[Test]
public void IfDieRollIsInExpression_ThrowArgumentException()
{
Assert.That(() => expressionEvaluator.Evaluate<int>("expression with 3 d 4+2"),
Assert.That((Func<int>)(() => expressionEvaluator.Evaluate<int>("expression with 3 d 4+2")),
Throws.ArgumentException.With.Message.EqualTo("Cannot evaluate unrolled die roll 3 d 4"));
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public void EvaluateExpressionThrowsException_WhenAlbatrossFailsToEvaluate()
var exception = new Exception("I failed");
mockExpression.Setup(t => t.Eval(null)).Throws(exception);

Assert.That(() => expressionEvaluator.Evaluate<int>(expression),
Assert.That((Func<int>)(() => expressionEvaluator.Evaluate<int>(expression)),
Throws.InvalidOperationException
.With.Message.EqualTo($"Expression 'wrong expression' is invalid")
.And.InnerException.EqualTo(exception));
Expand Down
34 changes: 17 additions & 17 deletions DnDGen.RollGen.Tests.Unit/PartialRolls/DomainPartialRollTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ public void ReturnAsIndividualRollsFromQuantityExpression_NoRoll_Int_MultipleRol

var rolls = partialRoll.AsIndividualRolls();
Assert.That(rolls.Count(), Is.EqualTo(2));
Assert.That(rolls, Is.EqualTo(new[] { 3, 2 }));
Assert.That(rolls, Is.EqualTo([3, 2]));
}

[Test]
Expand Down Expand Up @@ -2651,7 +2651,7 @@ public void ReturnNumericKeepingWithNumericQuantity()
var keptRolls = partialRoll.d(600).Keeping(42).AsIndividualRolls();
var expectedRolls = Enumerable.Range(66 - 41, 42);

Assert.That(keptRolls.Count, Is.EqualTo(42));
Assert.That(keptRolls.Count(), Is.EqualTo(42));
Assert.That(keptRolls, Is.EquivalentTo(expectedRolls));
}

Expand All @@ -2677,7 +2677,7 @@ public void ReturnKeepingExpressionWithNumericQuantity()

var keptRolls = partialRoll.d(42).Keeping("4d3").AsIndividualRolls();

Assert.That(keptRolls.Count, Is.EqualTo(1));
Assert.That(keptRolls.Count(), Is.EqualTo(1));
Assert.That(keptRolls.Single(), Is.EqualTo(42 * 7));
}

Expand Down Expand Up @@ -2723,7 +2723,7 @@ public void KeepThrowsException_IfInvalidRoll()
BuildPartialRoll(1);
partialRoll.d(1).Explode();

Assert.That(() => partialRoll.AsSum(),
Assert.That((Func<int>)(() => partialRoll.AsSum()),
Throws.InstanceOf<InvalidOperationException>().With.Message.EqualTo("1d1e1 is not a valid roll\n\tExplode: Must have at least 1 non-exploded roll"));
}

Expand Down Expand Up @@ -2804,7 +2804,7 @@ public void ParantheticalExpression(string expression, int expectedSum)
public void ParantheticalExpressionThrowsException_WhenParanthesesMismatched()
{
BuildPartialRoll("5*((1d2) + 1");
Assert.That(() => partialRoll.AsSum(),
Assert.That((Func<int>)(() => partialRoll.AsSum()),
Throws.InvalidOperationException.With.Message.EqualTo($"No closing paranthesis found for expression '5*((1d2) + 1'"));
}

Expand Down Expand Up @@ -3124,7 +3124,7 @@ public void AsSum_ThrowsException_WhenQuantityIsDecimal()
BuildPartialRoll(92.66);
partialRoll.d2();

Assert.That(() => partialRoll.AsSum<double>(),
Assert.That((Func<double>)(() => partialRoll.AsSum<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92.66d2"));
}

Expand All @@ -3134,7 +3134,7 @@ public void AsSum_ThrowsException_WhenDieIsDecimal()
BuildPartialRoll(92);
partialRoll.d("6.6");

Assert.That(() => partialRoll.AsSum<double>(),
Assert.That((Func<double>)(() => partialRoll.AsSum<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92d6.6"));
}

Expand All @@ -3144,7 +3144,7 @@ public void AsIndividualRolls_ThrowsException_WhenQuantityIsDecimal()
BuildPartialRoll(92.66);
partialRoll.d2();

Assert.That(() => partialRoll.AsIndividualRolls<double>(),
Assert.That((Func<object>)(() => partialRoll.AsIndividualRolls<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92.66d2"));
}

Expand All @@ -3154,7 +3154,7 @@ public void AsIndividualRolls_ThrowsException_WhenDieIsDecimal()
BuildPartialRoll(92);
partialRoll.d("6.6");

Assert.That(() => partialRoll.AsIndividualRolls<double>(),
Assert.That((Func<object>)(() => partialRoll.AsIndividualRolls<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92d6.6"));
}

Expand All @@ -3164,7 +3164,7 @@ public void AsMinimum_ThrowsException_WhenQuantityIsDecimal()
BuildPartialRoll(92.66);
partialRoll.d2();

Assert.That(() => partialRoll.AsPotentialMinimum<double>(),
Assert.That((Func<double>)(() => partialRoll.AsPotentialMinimum<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92.66d2"));
}

Expand All @@ -3174,7 +3174,7 @@ public void AsMinimum_ThrowsException_WhenDieIsDecimal()
BuildPartialRoll(92);
partialRoll.d("6.6");

Assert.That(() => partialRoll.AsPotentialMinimum<double>(),
Assert.That((Func<double>)(() => partialRoll.AsPotentialMinimum<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92d6.6"));
}

Expand All @@ -3184,7 +3184,7 @@ public void AsMaximum_ThrowsException_WhenQuantityIsDecimal()
BuildPartialRoll(92.66);
partialRoll.d2();

Assert.That(() => partialRoll.AsPotentialMaximum<double>(),
Assert.That((Func<double>)(() => partialRoll.AsPotentialMaximum<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92.66d2"));
}

Expand All @@ -3194,7 +3194,7 @@ public void AsMaximum_ThrowsException_WhenDieIsDecimal()
BuildPartialRoll(92);
partialRoll.d("6.6");

Assert.That(() => partialRoll.AsPotentialMaximum<double>(),
Assert.That((Func<double>)(() => partialRoll.AsPotentialMaximum<double>()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92d6.6"));
}

Expand All @@ -3204,7 +3204,7 @@ public void AsAverage_ThrowsException_WhenQuantityIsDecimal()
BuildPartialRoll(92.66);
partialRoll.d2();

Assert.That(() => partialRoll.AsPotentialAverage(),
Assert.That((Func<double>)(() => partialRoll.AsPotentialAverage()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92.66d2"));
}

Expand All @@ -3214,7 +3214,7 @@ public void AsAverage_ThrowsException_WhenDieIsDecimal()
BuildPartialRoll(92);
partialRoll.d("6.6");

Assert.That(() => partialRoll.AsPotentialAverage(),
Assert.That((Func<double>)(() => partialRoll.AsPotentialAverage()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92d6.6"));
}

Expand All @@ -3224,7 +3224,7 @@ public void AsTrueOrFalse_ThrowsException_WhenQuantityIsDecimal()
BuildPartialRoll(92.66);
partialRoll.d2();

Assert.That(() => partialRoll.AsTrueOrFalse(),
Assert.That((Func<bool>)(() => partialRoll.AsTrueOrFalse()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92.66d2"));
}

Expand All @@ -3235,7 +3235,7 @@ public void AsTrueOrFalse_ThrowsException_WhenDieIsDecimal()
partialRoll.d("6.6");
mockExpressionEvaluator.Setup(e => e.Evaluate<double>("6.6")).Returns((string s) => 6.6);

Assert.That(() => partialRoll.AsTrueOrFalse(),
Assert.That((Func<bool>)(() => partialRoll.AsTrueOrFalse()),
Throws.ArgumentException.With.Message.EqualTo("Cannot have decimal values for die rolls: 92d6.6"));
}

Expand Down
Loading
Loading