Skip to content
Permalink
Browse files

Fixed issues with HttPlaceholderClient and added / updated unit tests

  • Loading branch information...
Duco
Duco committed Jun 2, 2019
1 parent dff2bb4 commit ea3aed1d5c4a6a14f2951163a44b5643c557ad70
Showing with 422 additions and 1,462 deletions.
  1. +14 −3 src/HttPlaceholder.Application.Tests/StubExecution/Implementations/RequestLoggerFacts.cs
  2. +1 −13 src/HttPlaceholder.Client.Tests/HttPlaceholder.Client.Tests.csproj
  3. +0 −316 src/HttPlaceholder.Client.Tests/HttPlaceholderClientFacts.cs
  4. +35 −0 src/HttPlaceholder.Client.Tests/HttPlaceholderClientModuleFacts.cs
  5. +0 −146 src/HttPlaceholder.Client.Tests/TestResources.Designer.cs
  6. +0 −455 src/HttPlaceholder.Client.Tests/TestResources.resx
  7. +29 −178 src/HttPlaceholder.Client/HttPlaceholderClient.cs
  8. +9 −1 src/HttPlaceholder.Client/HttPlaceholderClientFactory.cs
  9. +1 −9 src/HttPlaceholder.Client/HttPlaceholderClientModule.cs
  10. +2 −2 src/HttPlaceholder.Client/client.nswag
  11. +2 −1 src/HttPlaceholder.Tests/HttPlaceholder.Tests.csproj
  12. +5 −0 src/HttPlaceholder.Tests/Integration/IntegrationTestBase.cs
  13. +18 −0 src/HttPlaceholder.Tests/Integration/RestApi/RestApiIntegrationTestBase.cs
  14. +5 −22 src/HttPlaceholder.Tests/Integration/RestApi/RestApiMetadataIntegrationTests.cs
  15. +25 −66 src/HttPlaceholder.Tests/Integration/RestApi/RestApiRequestIntegrationTests.cs
  16. +132 −99 src/HttPlaceholder.Tests/Integration/RestApi/RestApiStubIntegrationTests.cs
  17. +93 −70 src/HttPlaceholder.Tests/Integration/RestApi/RestApiTenantIntegrationTests.cs
  18. +30 −64 src/HttPlaceholder.Tests/Integration/RestApi/RestApiUserIntegrationTests.cs
  19. +2 −3 src/HttPlaceholder/Controllers/RequestController.cs
  20. +2 −2 src/HttPlaceholder/Controllers/StubController.cs
  21. +6 −6 src/HttPlaceholder/Controllers/TenantController.cs
  22. +4 −4 src/HttPlaceholder/Controllers/UserController.cs
  23. +5 −2 src/HttPlaceholder/Dto/Users/UserDto.cs
  24. +2 −0 src/HttPlaceholder/Utilities/StartupUtilities.cs
@@ -13,7 +13,18 @@ namespace HttPlaceholder.Application.Tests.StubExecution.Implementations
[TestClass]
public class RequestLoggerFacts
{
private RequestLogger _logger = new RequestLogger(new Mock<IDateTime>().Object);
private readonly DateTime _utcNow = DateTime.UtcNow;
private readonly Mock<IDateTime> _dateTimeMock = new Mock<IDateTime>();
private RequestLogger _logger;

[TestInitialize]
public void Initialize()
{
_dateTimeMock
.Setup(m => m.UtcNow)
.Returns(_utcNow);
_logger = new RequestLogger(_dateTimeMock.Object);
}

[TestMethod]
public void RequestLogger_GetResult_HappyFlow()
@@ -22,8 +33,8 @@ public void RequestLogger_GetResult_HappyFlow()
var result = _logger.GetResult();

// assert
Assert.AreEqual(DateTime.Now.Date, result.RequestBeginTime.Date);
Assert.AreEqual(DateTime.Now.Date, result.RequestEndTime.Date);
Assert.AreEqual(_utcNow, result.RequestBeginTime);
Assert.AreEqual(_utcNow, result.RequestEndTime);
}

[TestMethod]
@@ -8,24 +8,12 @@
<Configurations>Debug;Release;Tool</Configurations>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HttPlaceholder.Client\HttPlaceholder.Client.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="TestResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TestResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="TestResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>TestResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

This file was deleted.

0 comments on commit ea3aed1

Please sign in to comment.
You can’t perform that action at this time.