diff --git a/EnvelopeGenerator.Tests.Application/HistoryTests.cs b/EnvelopeGenerator.Tests.Application/HistoryTests.cs index da06e020..076cc8f9 100644 --- a/EnvelopeGenerator.Tests.Application/HistoryTests.cs +++ b/EnvelopeGenerator.Tests.Application/HistoryTests.cs @@ -16,7 +16,7 @@ public class HistoryTests { private IHost _host; - private IServiceProvider Provider => _host.Services; + private IMediator Mediator => _host.Services.GetRequiredService(); [SetUp] public void Setup() @@ -50,12 +50,6 @@ public class HistoryTests _host.Dispose(); } - private async Task Send(IRequest request) - { - var mediator = Provider.GetRequiredService(); - return await mediator.Send(request); - } - [Test] public async Task CreateHistory_And_ReadHistory_Should_Work() { @@ -69,14 +63,14 @@ public class HistoryTests }; // Act - var id = await Send(createCmd); + var id = await Mediator.Send(createCmd); // Assert Assert.That(id, Is.Not.Null); // ReadHistory sorgusu var query = new ReadHistoryQuery(1); - var result = await Send(query); + var result = await Mediator.Send(query); Assert.That(result, Is.Not.Empty); } @@ -99,11 +93,11 @@ public class HistoryTests Status = Constants.EnvelopeStatus.EnvelopePartlySigned }; - await Send(createCmd1); - await Send(createCmd2); + await Mediator.Send(createCmd1); + await Mediator.Send(createCmd2); // Act - var result = await Send(new ReadHistoryQuery(2, Constants.EnvelopeStatus.EnvelopePartlySigned)); + var result = await Mediator.Send(new ReadHistoryQuery(2, Constants.EnvelopeStatus.EnvelopePartlySigned)); // Assert Assert.That(result, Has.Exactly(1).Items); @@ -115,7 +109,7 @@ public class HistoryTests public async Task ReadHistory_Should_Return_Empty_When_No_Record() { // Act - var result = await Send(new ReadHistoryQuery(999)); + var result = await Mediator.Send(new ReadHistoryQuery(999)); // Assert Assert.That(result, Is.Empty); diff --git a/EnvelopeGenerator.sln b/EnvelopeGenerator.sln index 8b041a64..15c236e2 100644 --- a/EnvelopeGenerator.sln +++ b/EnvelopeGenerator.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 17.5.33516.290 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EnvelopeGenerator.BBTests", "EnvelopeGenerator.BBTests\EnvelopeGenerator.BBTests.vbproj", "{089D5634-FB6B-42D0-B912-7AA7457044E7}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EnvelopeGenerator.Form", "EnvelopeGenerator.Form\EnvelopeGenerator.Form.vbproj", "{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}" -EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EnvelopeGenerator.CommonServices", "EnvelopeGenerator.CommonServices\EnvelopeGenerator.CommonServices.vbproj", "{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvelopeGenerator.Web", "EnvelopeGenerator.Web\EnvelopeGenerator.Web.csproj", "{5E0E17C0-FF5A-4246-BF87-1ADD85376A27}" @@ -45,10 +43,6 @@ Global {089D5634-FB6B-42D0-B912-7AA7457044E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {089D5634-FB6B-42D0-B912-7AA7457044E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {089D5634-FB6B-42D0-B912-7AA7457044E7}.Release|Any CPU.Build.0 = Release|Any CPU - {6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {6D56C01F-D6CB-4D8A-BD3D-4FD34326998C}.Release|Any CPU.Build.0 = Debug|Any CPU {6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -91,7 +85,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {089D5634-FB6B-42D0-B912-7AA7457044E7} = {0CBC2432-A561-4440-89BC-671B66A24146} - {6D56C01F-D6CB-4D8A-BD3D-4FD34326998C} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB} {6EA0C51F-C2B1-4462-8198-3DE0B32B74F8} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB} {5E0E17C0-FF5A-4246-BF87-1ADD85376A27} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB} {83ED2617-B398-4859-8F59-B38F8807E83E} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}