-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize test blueprints where appropriate
- Loading branch information
1 parent
1048dcd
commit 9ca159f
Showing
4 changed files
with
82 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
test/FactorioTools.Test/OilField/RejectsBlueprintWithBlockingIsolatedArea/Theory.cs
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
test/FactorioTools.Test/OilField/Steps/CleanBlueprintTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Knapcode.FactorioTools.OilField.Steps; | ||
|
||
public class CleanBlueprintTest : PlannerFacts | ||
{ | ||
[Theory] | ||
[MemberData(nameof(BigListIndexTestData))] | ||
public void BigListBlueprintsAreNormalized(int blueprintIndex) | ||
{ | ||
// Arrange | ||
var expected = BigListBlueprintStrings[blueprintIndex]; | ||
string actual = Clean(expected); | ||
|
||
// Assert | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
private static string Clean(string expected) | ||
{ | ||
var blueprint = ParseBlueprint.Execute(expected); | ||
|
||
// Act | ||
var clean = CleanBlueprint.Execute(blueprint); | ||
var actual = GridToBlueprintString.SerializeBlueprint(clean, addFbeOffset: false); | ||
return actual; | ||
} | ||
|
||
[Theory] | ||
[MemberData(nameof(SmallListIndexTestData))] | ||
public void SmallListBlueprintsAreNormalized(int blueprintIndex) | ||
{ | ||
// Arrange | ||
var expected = SmallListBlueprintStrings[blueprintIndex]; | ||
var blueprint = ParseBlueprint.Execute(expected); | ||
|
||
// Act | ||
var clean = CleanBlueprint.Execute(blueprint); | ||
var actual = GridToBlueprintString.SerializeBlueprint(clean, addFbeOffset: false); | ||
|
||
// Assert | ||
Assert.Equal(expected, actual); | ||
} | ||
} | ||
|