Refactor Tests structure; Move HttpClient to it's own folder
This commit is contained in:
parent
dcd51ecd3d
commit
350fc6bc77
6 changed files with 12 additions and 7 deletions
|
@ -5,6 +5,7 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using NucuCar.Domain;
|
using NucuCar.Domain;
|
||||||
|
using NucuCar.Domain.Http;
|
||||||
using NucuCar.Domain.Telemetry;
|
using NucuCar.Domain.Telemetry;
|
||||||
using NucuCar.Domain.Utilities;
|
using NucuCar.Domain.Utilities;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging;
|
||||||
using sNetHttp = System.Net.Http;
|
using sNetHttp = System.Net.Http;
|
||||||
using sNetHttpHeaders = System.Net.Http.Headers;
|
using sNetHttpHeaders = System.Net.Http.Headers;
|
||||||
|
|
||||||
namespace NucuCar.Domain
|
namespace NucuCar.Domain.Http
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A simple HttpClient wrapper designed to make it easier to work with web requests with media type application/json.
|
/// A simple HttpClient wrapper designed to make it easier to work with web requests with media type application/json.
|
|
@ -1,11 +1,10 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using HttpClient = NucuCar.Domain.HttpClient;
|
|
||||||
|
|
||||||
namespace NucuCar.UnitTests.NucuCar.Common.Tests
|
namespace NucuCar.Domain.Http
|
||||||
{
|
{
|
||||||
public class MockHttpClient : Domain.HttpClient
|
public class MockHttpClient : Domain.Http.HttpClient
|
||||||
{
|
{
|
||||||
public List<HttpRequestMessage> SendAsyncArgCalls;
|
public List<HttpRequestMessage> SendAsyncArgCalls;
|
||||||
public List<HttpResponseMessage> SendAsyncResponses;
|
public List<HttpResponseMessage> SendAsyncResponses;
|
|
@ -5,11 +5,11 @@ using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using NucuCar.Domain.Http;
|
||||||
using NucuCar.Domain.Telemetry;
|
using NucuCar.Domain.Telemetry;
|
||||||
using NucuCar.Telemetry;
|
using NucuCar.Telemetry;
|
||||||
using NucuCar.UnitTests.NucuCar.Common.Tests;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using HttpClient = NucuCar.Domain.HttpClient;
|
using HttpClient = NucuCar.Domain.Http.HttpClient;
|
||||||
|
|
||||||
namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests
|
namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ namespace NucuCar.UnitTests.NucuCar.Telemetry.Tests
|
||||||
await publisher.PublishAsync(cts.Token);
|
await publisher.PublishAsync(cts.Token);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.Equal(mockHttpClient.SendAsyncArgCalls.Count, 0);
|
Assert.Empty(mockHttpClient.SendAsyncArgCalls);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
<Assembly Path="/home/denis/.nuget/packages/iot.device.bindings/1.0.0/lib/netcoreapp2.1/Iot.Device.Bindings.dll" />
|
<Assembly Path="/home/denis/.nuget/packages/iot.device.bindings/1.0.0/lib/netcoreapp2.1/Iot.Device.Bindings.dll" />
|
||||||
<Assembly Path="/home/denis/.nuget/packages/firebaseresttranslator/0.1.1/lib/netcoreapp3.0/FirebaseRestTranslator.dll" />
|
<Assembly Path="/home/denis/.nuget/packages/firebaseresttranslator/0.1.1/lib/netcoreapp3.0/FirebaseRestTranslator.dll" />
|
||||||
</AssemblyExplorer></s:String>
|
</AssemblyExplorer></s:String>
|
||||||
|
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=271bcc38_002D67df_002D4a50_002D94ca_002D524c78a6d97e/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Test_PublishAsync_Cancel" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||||
|
<TestAncestor>
|
||||||
|
<TestId>xUnit::C6F07921-1052-4945-911E-F328A622F229::.NETCoreApp,Version=v3.1::NucuCar.UnitTests.NucuCar.Telemetry.Tests.TelemetryPublisherFirestoreTest.Test_PublishAsync_Cancel</TestId>
|
||||||
|
</TestAncestor>
|
||||||
|
</SessionState></s:String>
|
||||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=59acec6f_002Dda48_002D4e34_002Dbf2a_002D5b52d718278a/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Test_PublishAsync_Authorization_OK" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=59acec6f_002Dda48_002D4e34_002Dbf2a_002D5b52d718278a/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" Name="Test_PublishAsync_Authorization_OK" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||||
<TestAncestor>
|
<TestAncestor>
|
||||||
<TestId>xUnit::C6F07921-1052-4945-911E-F328A622F229::.NETCoreApp,Version=v3.1::NucuCar.UnitTests.NucuCar.Telemetry.Tests.TelemetryPublisherFirestoreTest.Test_PublishAsync_Authorization_OK</TestId>
|
<TestId>xUnit::C6F07921-1052-4945-911E-F328A622F229::.NETCoreApp,Version=v3.1::NucuCar.UnitTests.NucuCar.Telemetry.Tests.TelemetryPublisherFirestoreTest.Test_PublishAsync_Authorization_OK</TestId>
|
||||||
|
|
Loading…
Reference in a new issue