Skip to content

Commit

Permalink
Upgrade Rees Test Utils.
Browse files Browse the repository at this point in the history
Remove local AssertExtension.
  • Loading branch information
Benrnz committed Jan 1, 2025
1 parent c2986c2 commit 3f17b2c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 30 deletions.
20 changes: 0 additions & 20 deletions BudgetAnalyser.Engine.UnitTest/AssertExtension.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="Portable.Xaml" Version="0.26.0" />
<PackageReference Include="Rees.UnitTestUtilities" Version="2.0.0" />
<PackageReference Include="Rees.UnitTestUtilities" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using BudgetAnalyser.Engine.UnitTest.Helper;
using BudgetAnalyser.Engine.UnitTest.TestData;
using BudgetAnalyser.Engine.UnitTest.TestHarness;
using Rees.UnitTestUtilities;

namespace BudgetAnalyser.Engine.UnitTest.Reports;

Expand Down Expand Up @@ -80,7 +81,7 @@ public void Analyse_ShouldReturnCorrectAverageSpend_Fortnight()

var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);

AssertExtensions.AreEqualWithTolerance(-461.54M, result.AverageSpend);
Ensure.AreEqualWithTolerance(-461.54M, result.AverageSpend);
}

[TestMethod]
Expand All @@ -99,7 +100,7 @@ public void Analyse_ShouldReturnCorrectAverageSurplus_Fortnight()

var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);

AssertExtensions.AreEqualWithTolerance(-230.77M, result.AverageSurplus);
Ensure.AreEqualWithTolerance(-230.77M, result.AverageSurplus);
}

[TestMethod]
Expand Down Expand Up @@ -137,7 +138,7 @@ public void Analyse_ShouldReturnCorrectOverallPerformanceRating_Fortnight()

var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);

AssertExtensions.AreEqualWithTolerance(8020M, result.OverallPerformance);
Ensure.AreEqualWithTolerance(8020M, result.OverallPerformance);
}

[TestMethod]
Expand All @@ -157,7 +158,7 @@ public void Analyse_ShouldReturnResultCorrectAvgForCarMtc_Fortnight()
var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);
var avgCarMtc = result.Analyses.Single(b => b.Bucket.Code == StatementModelTestData.CarMtcBucket.Code).AverageSpend;

AssertExtensions.AreEqualWithTolerance(92.31M, avgCarMtc);
Ensure.AreEqualWithTolerance(92.31M, avgCarMtc);
}

[TestMethod]
Expand All @@ -177,7 +178,7 @@ public void Analyse_ShouldReturnResultCorrectAvgForHair_Fortnight()
var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);
var avgHair = result.Analyses.Single(b => b.Bucket.Code == StatementModelTestData.HairBucket.Code).AverageSpend;

AssertExtensions.AreEqualWithTolerance(138.46M, avgHair);
Ensure.AreEqualWithTolerance(138.46M, avgHair);
}

[TestMethod]
Expand All @@ -197,7 +198,7 @@ public void Analyse_ShouldReturnResultCorrectAvgForPhone_Fortnight()
var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);
var avgPhone = result.Analyses.Single(b => b.Bucket.Code == StatementModelTestData.PhoneBucket.Code).AverageSpend;

AssertExtensions.AreEqualWithTolerance(46.15M, avgPhone);
Ensure.AreEqualWithTolerance(46.15M, avgPhone);
}

[TestMethod]
Expand All @@ -217,7 +218,7 @@ public void Analyse_ShouldReturnResultCorrectAvgForPower_Fortnight()
var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);
var avgPower = result.Analyses.Single(b => b.Bucket.Code == StatementModelTestData.PowerBucket.Code).AverageSpend;

AssertExtensions.AreEqualWithTolerance(184.62M, avgPower);
Ensure.AreEqualWithTolerance(184.62M, avgPower);
}

[TestMethod]
Expand All @@ -237,7 +238,7 @@ public void Analyse_ShouldReturnResultCorrectAvgForSurplus_Fortnight()
var result = this.analyser!.Analyse(this.statementTestData, this.budgetsTestData, this.dateCriteria);
var avgSurplus = result.Analyses.Single(b => b.Bucket.Code == StatementModelTestData.SurplusBucket.Code).AverageSpend;

AssertExtensions.AreEqualWithTolerance(230.77M, avgSurplus);
Ensure.AreEqualWithTolerance(230.77M, avgSurplus);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
<PackageReference Include="Rees.UnitTestUtilities" Version="2.0.0" />
<PackageReference Include="Rees.UnitTestUtilities" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 3f17b2c

Please sign in to comment.