generated from goatcorp/SamplePlugin
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rearrange existing unit tests to match new namespace structure for utils
- Loading branch information
Showing
5 changed files
with
70 additions
and
56 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
2 changes: 1 addition & 1 deletion
2
...tHelperTests/Util/FsCheck/FsCheckUtils.cs → ...erTests/TestUtils/FsCheck/FsCheckUtils.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Dalamud.Game.ClientState.Objects.SubKinds; | ||
using Dalamud.Plugin.Services; | ||
using FluentAssertions; | ||
using FsCheck; | ||
using FsCheck.Xunit; | ||
using Moq; | ||
using ScoutHelper.Utils; | ||
using ScoutHelperTests.TestUtils.FsCheck; | ||
using static ScoutHelper.Utils.Utils; | ||
|
||
namespace ScoutHelperTests.Utils; | ||
|
||
public class UtilsTests { | ||
|
||
|
||
[Fact] | ||
public void WorldName_NoPlayer() { | ||
// DATA | ||
var clientState = new Mock<IClientState>(); | ||
|
||
// GIVEN | ||
clientState.Setup(state => state.LocalPlayer).Returns(null as PlayerCharacter); | ||
|
||
// WHEN | ||
var worldName = clientState.Object.WorldName(); | ||
|
||
// THEN | ||
worldName.Should().Be("Not Found"); | ||
} | ||
|
||
[Property] | ||
public Property FormatTemplate_FormatsCorrectly() => FsCheckUtils.ForAll( | ||
Arbs.CopyTemplate(), | ||
copyTemplate => { | ||
// WHEN | ||
var actual = FormatTemplate( | ||
copyTemplate.Template, | ||
copyTemplate.TrainList, | ||
copyTemplate.Tracker, | ||
copyTemplate.WorldName, | ||
copyTemplate.HighestPatch, | ||
copyTemplate.Link | ||
); | ||
// THEN | ||
actual.Should().Be(copyTemplate.Expected); | ||
} | ||
); | ||
} | ||
|
||
internal enum TestEnum { | ||
A, | ||
B, | ||
C, | ||
D, | ||
E | ||
} |