Skip to content

Commit

Permalink
Fixed issues with HttPlaceholderClient and added / updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Duco committed Jun 2, 2019
1 parent dff2bb4 commit ea3aed1
Show file tree
Hide file tree
Showing 24 changed files with 422 additions and 1,462 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
316 changes: 0 additions & 316 deletions src/HttPlaceholder.Client.Tests/HttPlaceholderClientFacts.cs

This file was deleted.

Loading

0 comments on commit ea3aed1

Please sign in to comment.