-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from AlamoEngine-Tools/spec-4
Update to Spec verison 4
- Loading branch information
Showing
17 changed files
with
568 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.IO.Abstractions; | ||
using System.IO.Abstractions.TestingHelpers; | ||
using EawModinfo.Model; | ||
using EawModinfo.Spec; | ||
using EawModinfo.Utilities; | ||
using Xunit; | ||
|
||
namespace EawModinfo.Tests; | ||
|
||
public class DetectedModReferenceTest | ||
{ | ||
private readonly IFileSystem _fileSystem = new MockFileSystem(); | ||
|
||
[Fact] | ||
public void Constructor_ThrowsArgumentNullException() | ||
{ | ||
var modReference = new ModReference("TestMod", ModType.Default); | ||
var directory = _fileSystem.DirectoryInfo.New("TestDirectory"); | ||
Assert.Throws<ArgumentNullException>(() => new DetectedModReference(modReference, null!, null)); | ||
Assert.Throws<ArgumentNullException>(() => new DetectedModReference(null!, directory, null)); | ||
} | ||
|
||
[Theory] | ||
[InlineData(null)] | ||
[InlineData("string")] | ||
public void Constructor_InitializesPropertiesCorrectly_WhenValidArgumentsArePassed(string? modName) | ||
{ | ||
var directory = _fileSystem.DirectoryInfo.New("TestDirectory"); | ||
var modReference = new ModReference("TestMod", ModType.Default); | ||
IModinfo? modinfo = modName is null ? null : new ModinfoData(modName); | ||
|
||
var detectedModReference = new DetectedModReference(modReference, directory, modinfo); | ||
|
||
Assert.Equal(modReference, detectedModReference.ModReference); | ||
Assert.Same(directory, detectedModReference.Directory); | ||
Assert.Same(modinfo, detectedModReference.Modinfo); | ||
} | ||
} |
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
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
Oops, something went wrong.