-
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.
- Loading branch information
Showing
4 changed files
with
83 additions
and
7 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...Core.Tests.Unit/Services/Foundations/Assemblies/AssemblyServiceTests.Logic.GetAssembly.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,51 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Reflection.Emit; | ||
using System.Runtime.CompilerServices; | ||
using System.Threading.Tasks; | ||
using FluentAssertions; | ||
using Moq; | ||
|
||
namespace STX.SPAL.Core.Tests.Unit.Services.Foundations.Assemblies | ||
{ | ||
public partial class AssemblyServiceTests | ||
{ | ||
[Fact] | ||
private async Task ShouldGetAssembly() | ||
Check warning on line 18 in STX.SPAL.Core.Tests.Unit/Services/Foundations/Assemblies/AssemblyServiceTests.Logic.GetAssembly.cs
|
||
{ | ||
// given | ||
Assembly randomAssembly = CreateRandomAssembly(); | ||
Assembly expectedAssembly = randomAssembly; | ||
Assembly returnedAssembly = randomAssembly; | ||
string randomPathAssembly = GetRandomPathAssembly(); | ||
string inputPathAssembly = randomPathAssembly; | ||
|
||
this.assemblyBroker | ||
.Setup(broker => | ||
broker.GetAssembly( | ||
It.Is<string>(actualPathAssembly => | ||
actualPathAssembly == inputPathAssembly))) | ||
.Returns(returnedAssembly); | ||
|
||
// when | ||
Assembly actualAssembly = | ||
this.assemblyService.GetAssembly(inputPathAssembly); | ||
|
||
//then | ||
actualAssembly.Should().BeSameAs(expectedAssembly); | ||
|
||
this.assemblyBroker.Verify( | ||
broker => | ||
broker.GetAssembly( | ||
It.Is<string>(actualPathAssembly => | ||
actualPathAssembly == inputPathAssembly)), | ||
Times.Once); | ||
|
||
this.assemblyBroker.VerifyNoOtherCalls(); | ||
} | ||
} | ||
} |
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