-
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.
- Loading branch information
1 parent
687994b
commit 41ada18
Showing
18 changed files
with
186 additions
and
115 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
10 changes: 2 additions & 8 deletions
10
src/LINDI.Tests/AwaitableBindingTests.cs → ...LINDI.Tests/Core/AwaitableBindingTests.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Lindi.Core.Bindings; | ||
using Xunit; | ||
|
||
namespace Lindi.Tests.Core.Bindings | ||
{ | ||
class MockBaseBinding<TInterafce> : BaseBinding<TInterafce> | ||
{ | ||
protected override TInterafce ResolveImplementation() | ||
{ | ||
throw new Exception(); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Tests for <see cref="BaseBinding{TInterface}"/>. | ||
/// </summary> | ||
public class BaseBindingTests | ||
{ | ||
[Fact] | ||
public void Test_BaseBinding_Wraps_Exception_In_BindingResolutionException() | ||
{ | ||
MockBaseBinding<ISample> binding = new MockBaseBinding<ISample>(); | ||
|
||
Assert.Throws<BindingResolutionException>(() => | ||
{ | ||
var sample = binding.Resolve(); | ||
}); | ||
} | ||
} | ||
} |
6 changes: 1 addition & 5 deletions
6
src/LINDI.Tests/BindToConstructorTests.cs → ...s/Core/Bindings/BindToConstructorTests.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
6 changes: 1 addition & 5 deletions
6
....Tests/BindingResolutionExceptionTests.cs → ...ndings/BindingResolutionExceptionTests.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
9 changes: 2 additions & 7 deletions
9
...LINDI.Tests/LazyBindToConstructorTests.cs → ...re/Bindings/LazyBindToConstructorTests.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Linq.Expressions; | ||
using Lindi.Core; | ||
using Xunit; | ||
|
||
namespace Lindi.Tests.Core | ||
{ | ||
/// <summary> | ||
/// Tests for <see cref="ExpressionHelpers"/> methods. | ||
/// </summary> | ||
public class ExpressionHelpersTests | ||
{ | ||
[Fact] | ||
public void Test_Lock_Throws_When_Given_Null_LockObj_Expression() | ||
{ | ||
Assert.Throws<ArgumentNullException>(() => | ||
{ | ||
ExpressionHelpers.Lock(null, Expression.Parameter(typeof(int))); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void Test_Lock_Throws_When_Given_Null_Body_Expression() | ||
{ | ||
Assert.Throws<ArgumentNullException>(() => | ||
{ | ||
ExpressionHelpers.Lock(Expression.Parameter(typeof(int)), null); | ||
}); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/LINDI.Tests/HasSample.cs → src/LINDI.Tests/Core/HasSample.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Lindi.Tests | ||
namespace Lindi.Tests.Core | ||
{ | ||
public class HasSample : IHasSample | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
src/LINDI.Tests/IHasSample.cs → src/LINDI.Tests/Core/IHasSample.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Lindi.Tests | ||
namespace Lindi.Tests.Core | ||
{ | ||
public interface IHasSample | ||
{ | ||
|
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,4 +1,4 @@ | ||
namespace Lindi.Tests | ||
namespace Lindi.Tests.Core | ||
{ | ||
public interface ISample | ||
{ | ||
|
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.