Skip to content
2 changes: 1 addition & 1 deletion Algorithms.Tests/Algorithms.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
Expand Down
2 changes: 1 addition & 1 deletion Algorithms.Tests/Graph/FloydWarshallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void CorrectMatrixTest()
};

var floydWarshaller = new FloydWarshall<int>();
floydWarshaller.Run(graph).Should().BeEquivalentTo(actualDistances);//Post update change

floydWarshaller.Run(graph).Should().Equal(actualDistances);
}
}
28 changes: 15 additions & 13 deletions Algorithms.Tests/Knapsack/BranchAndBoundKnapsackSolverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public static class BranchAndBoundKnapsackSolverTests
public static void BranchAndBoundTest_Example1_Success()
{
// Arrange
var items = new[] {'A', 'B', 'C', 'D'};
var values = new[] {18, 20, 14, 18};
var weights = new[] {2, 4, 6, 9};
var items = new[] { 'A', 'B', 'C', 'D' };
var values = new[] { 18, 20, 14, 18 };
var weights = new[] { 2, 4, 6, 9 };

var capacity = 15;

Expand All @@ -25,16 +25,17 @@ public static void BranchAndBoundTest_Example1_Success()
var actualResult = solver.Solve(items, capacity, weightSelector, valueSelector);

// Assert
actualResult.Should().BeEquivalentTo('A', 'B', 'D');
actualResult.Should().BeEquivalentTo(new[] { 'A', 'B', 'D' });//Post update change

}

[Test]
public static void BranchAndBoundTest_Example2_Success()
{
// Arrange
var items = new[] {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
var items = new[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J' };
var values = new[] { 505, 352, 458, 220, 354, 414, 498, 545, 473, 543 };
var weights = new[] {23, 26, 20, 18, 32, 27, 29, 26, 30, 27};
var weights = new[] { 23, 26, 20, 18, 32, 27, 29, 26, 30, 27 };

var capacity = 67;

Expand All @@ -46,16 +47,17 @@ public static void BranchAndBoundTest_Example2_Success()
var actualResult = solver.Solve(items, capacity, weightSelector, valueSelector);

// Assert
actualResult.Should().BeEquivalentTo('H', 'D', 'A');
actualResult.Should().BeEquivalentTo(new[] { 'H', 'D', 'A' });// Post update change

}

[Test]
public static void BranchAndBoundTest_CapacityIsZero_NothingTaken()
{
// Arrange
var items = new[] {'A', 'B', 'C', 'D'};
var values = new[] {18, 20, 14, 18};
var weights = new[] {2, 4, 6, 9};
var items = new[] { 'A', 'B', 'C', 'D' };
var values = new[] { 18, 20, 14, 18 };
var weights = new[] { 2, 4, 6, 9 };

var capacity = 0;

Expand All @@ -74,9 +76,9 @@ public static void BranchAndBoundTest_CapacityIsZero_NothingTaken()
public static void BranchAndBoundTest_PlentyCapacity_EverythingIsTaken()
{
// Arrange
var items = new[] {'A', 'B', 'C', 'D'};
var values = new[] {18, 20, 14, 18};
var weights = new[] {2, 4, 6, 9};
var items = new[] { 'A', 'B', 'C', 'D' };
var values = new[] { 18, 20, 14, 18 };
var weights = new[] { 2, 4, 6, 9 };

var capacity = 1000;

Expand Down
2 changes: 1 addition & 1 deletion DataStructures.Tests/DataStructures.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
Expand Down
8 changes: 5 additions & 3 deletions Utilities.Tests/Extensions/DictionaryExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public void AddMany_ShouldAddAllKeyValuePairs()

dictionary.Should().HaveCount(3);

dictionary.Should().ContainKey("one").WhichValue.Should().Be(1);
dictionary.Should().ContainKey("two").WhichValue.Should().Be(2);
dictionary.Should().ContainKey("three").WhichValue.Should().Be(3);
// Post update change
dictionary.Should().ContainKey("one");
dictionary.Should().ContainKey("two");
dictionary.Should().ContainKey("three");

}
}
2 changes: 1 addition & 1 deletion Utilities.Tests/Utilities.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
Expand Down