-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abc6965
commit 87aaea4
Showing
1 changed file
with
43 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
using System.Reflection; | ||
using FakeItEasy; | ||
using NUnit.Framework; | ||
using VampireCommandFramework; | ||
|
||
namespace VCF.Tests; | ||
|
||
public class InitializationTests | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
{ | ||
CommandRegistry.Reset(); | ||
} | ||
|
||
[TearDown] | ||
public void TearDown() | ||
{ | ||
CommandRegistry.Reset(); | ||
} | ||
|
||
[Test] | ||
public void ScanningInterfaceDoesNotCauseException() | ||
{ | ||
Assert.DoesNotThrow(ScanAssemblyContainingInterface); | ||
} | ||
|
||
private void ScanAssemblyContainingInterface() | ||
{ | ||
CommandRegistry.RegisterAll(AssemblyContainingInterface()); | ||
} | ||
|
||
private Assembly AssemblyContainingInterface() | ||
{ | ||
var mockAssembly = A.Fake<Assembly>(); | ||
A.CallTo(() => mockAssembly.GetTypes()).Returns(new Type[]{ | ||
typeof(ISomeInterface), | ||
}); | ||
return mockAssembly; | ||
} | ||
|
||
private interface ISomeInterface; | ||
|
||
using System.Reflection; | ||
using FakeItEasy; | ||
using NUnit.Framework; | ||
using VampireCommandFramework; | ||
|
||
namespace VCF.Tests; | ||
|
||
public class InitializationTests | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
{ | ||
CommandRegistry.Reset(); | ||
} | ||
|
||
[TearDown] | ||
public void TearDown() | ||
{ | ||
CommandRegistry.Reset(); | ||
} | ||
|
||
[Test] | ||
public void ScanningInterfaceDoesNotCauseException() | ||
{ | ||
Assert.DoesNotThrow(ScanAssemblyContainingInterface); | ||
} | ||
|
||
private void ScanAssemblyContainingInterface() | ||
{ | ||
CommandRegistry.RegisterAll(AssemblyContainingInterface()); | ||
} | ||
|
||
private Assembly AssemblyContainingInterface() | ||
{ | ||
var mockAssembly = A.Fake<Assembly>(); | ||
A.CallTo(() => mockAssembly.GetTypes()).Returns(new Type[]{ | ||
typeof(ISomeInterface), | ||
}); | ||
return mockAssembly; | ||
} | ||
|
||
private interface ISomeInterface; | ||
Check failure on line 42 in VCF.Tests/InitializationTests.cs GitHub Actions / build
Check failure on line 42 in VCF.Tests/InitializationTests.cs GitHub Actions / build
Check failure on line 42 in VCF.Tests/InitializationTests.cs GitHub Actions / build
|
||
|
||
} |