Skip to content

Commit c86a6ec

Browse files
committed
All tests are working again
1 parent 278bc36 commit c86a6ec

File tree

29 files changed

+33506
-35696
lines changed

29 files changed

+33506
-35696
lines changed

src/Server/Coderr.Server.Api.Client.Tests/Coderr.Server.Api.Client.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
3+
<TargetFramework>net461</TargetFramework>
44
<RootNamespace>Coderr.Server.Api.Client.Tests</RootNamespace>
55
<AssemblyName>Coderr.Server.Api.Client.Tests</AssemblyName>
66
</PropertyGroup>

src/Server/Coderr.Server.Api.Client/OneTrueClient.cs renamed to src/Server/Coderr.Server.Api.Client/ServerApiClient.cs

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,12 @@ public class ServerApiClient : IMessageBus, IQueryBus
2323
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
2424
ContractResolver = new IncludeNonPublicMembersContractResolver()
2525
};
26+
2627
private string _apiKey;
2728
private string _sharedSecret;
2829
private Uri _uri;
2930

30-
async Task<TResult> IQueryBus.QueryAsync<TResult>(ClaimsPrincipal user, Query<TResult> query)
31-
{
32-
//TODO: Unwrap the cqs object to query parameters instead
33-
//to allow caching in the server
34-
var response = await RequestAsync("POST", "query", query);
35-
return await DeserializeResponse<TResult>(response);
36-
37-
}
3831

39-
public async Task<TResult> QueryAsync<TResult>(Query<TResult> query)
40-
{
41-
//TODO: Unwrap the cqs object to query parameters instead
42-
//to allow caching in the server
43-
var response = await RequestAsync("POST", "query", query);
44-
return await DeserializeResponse<TResult>(response);
45-
}
46-
47-
4832
async Task IMessageBus.SendAsync(ClaimsPrincipal principal, object message)
4933
{
5034
await RequestAsync("POST", "send", message);
@@ -60,11 +44,38 @@ async Task IMessageBus.SendAsync(Message message)
6044
await RequestAsync("POST", "send", message.Body);
6145
}
6246

47+
/// <summary>
48+
/// Send a command or event
49+
/// </summary>
50+
/// <param name="message">message</param>
51+
/// <returns>task</returns>
6352
public async Task SendAsync(object message)
6453
{
6554
await RequestAsync("POST", "send", message);
6655
}
6756

57+
async Task<TResult> IQueryBus.QueryAsync<TResult>(ClaimsPrincipal user, Query<TResult> query)
58+
{
59+
//TODO: Unwrap the cqs object to query parameters instead
60+
//to allow caching in the server
61+
var response = await RequestAsync("POST", "query", query);
62+
return await DeserializeResponse<TResult>(response);
63+
}
64+
65+
/// <summary>
66+
/// Make a query
67+
/// </summary>
68+
/// <typeparam name="TResult">Type of result that the query returns</typeparam>
69+
/// <param name="query">query to invoke</param>
70+
/// <returns>task</returns>
71+
public async Task<TResult> QueryAsync<TResult>(Query<TResult> query)
72+
{
73+
//TODO: Unwrap the cqs object to query parameters instead
74+
//to allow caching in the server
75+
var response = await RequestAsync("POST", "query", query);
76+
return await DeserializeResponse<TResult>(response);
77+
}
78+
6879

6980
/// <summary>
7081
/// Open a channel
@@ -78,7 +89,7 @@ public void Open(Uri uri, string apiKey, string sharedSecret)
7889
_sharedSecret = sharedSecret ?? throw new ArgumentNullException(nameof(sharedSecret));
7990
_uri = uri ?? throw new ArgumentNullException(nameof(uri));
8091
}
81-
92+
8293

8394
private async Task<TResult> DeserializeResponse<TResult>(HttpWebResponse response)
8495
{

src/Server/Coderr.Server.App.Tests/Coderr.Server.App.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
3+
<TargetFramework>net461</TargetFramework>
44
<RootNamespace>Coderr.Server.App.Tests</RootNamespace>
55
<AssemblyName>Coderr.Server.App.Tests</AssemblyName>
66
</PropertyGroup>

src/Server/Coderr.Server.ReportAnalyzer.Tests/app.config

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Server/Coderr.Server.ReportAnalyzer.Tests/codeRR.Server.ReportAnalyzer.Tests.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
4-
<RootNamespace>Coderr.Server.ReportAnalyzer.Tests</RootNamespace>
5-
<AssemblyName>Coderr.Server.ReportAnalyzer.Tests</AssemblyName>
3+
<TargetFramework>net461</TargetFramework>
4+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
5+
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
66
</PropertyGroup>
7+
78
<ItemGroup>
89
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.1" />
910
<PackageReference Include="xunit" Version="2.3.1" />
1011
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
1112
<PackageReference Include="FluentAssertions" Version="5.2.0" />
1213
<PackageReference Include="NSubstitute" Version="3.1.0" />
1314
</ItemGroup>
15+
1416
<ItemGroup>
1517
<ProjectReference Include="..\Coderr.Server.Domain\Coderr.Server.Domain.csproj" />
1618
<ProjectReference Include="..\Coderr.Server.ReportAnalyzer\Coderr.Server.ReportAnalyzer.csproj" />
1719
</ItemGroup>
20+
1821
<ItemGroup>
1922
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}"></Service>
2023
</ItemGroup>

src/Server/Coderr.Server.ReportAnalyzer/Boot/Bootstrapper.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
using Coderr.Server.Abstractions.Config;
77
using Coderr.Server.Abstractions.Security;
88
using Coderr.Server.Infrastructure.Configuration.Database;
9-
using Coderr.Server.ReportAnalyzer.Abstractions.Incidents;
109
using Coderr.Server.ReportAnalyzer.Boot.Adapters;
11-
using DotNetCqs;
12-
using DotNetCqs.Queues;
1310
using Griffin.Data;
1411
using Microsoft.Extensions.DependencyInjection;
1512

@@ -18,7 +15,6 @@ namespace Coderr.Server.ReportAnalyzer.Boot
1815
public class Bootstrapper : IAppModule
1916
{
2017
private readonly ModuleStarter _moduleStarter;
21-
private DomainQueueWrapper _domainQueue;
2218
private ServiceProvider _serviceProvider;
2319
private readonly ClaimsPrincipal _systemPrincipal;
2420

src/Server/Coderr.Server.ReportAnalyzer/ErrorReports/HashcodeGenerators/FileNotFoundHttpErrorGenerator.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
using System.Linq;
33
using Coderr.Server.Abstractions.Boot;
44
using Coderr.Server.Domain.Core.ErrorReports;
5-
using Coderr.Server.Abstractions.Boot;
6-
using Coderr.Server.ReportAnalyzer.Abstractions.Boot;
75
using log4net;
86

97
namespace Coderr.Server.ReportAnalyzer.ErrorReports.HashcodeGenerators
@@ -45,8 +43,7 @@ public string GenerateHashCode(ErrorReportEntity entity)
4543
return null;
4644
}
4745

48-
string value;
49-
if (!props.Properties.TryGetValue("HttpCode", out value))
46+
if (!props.Properties.TryGetValue("HttpCode", out var value))
5047
return null;
5148
var statusCode = int.Parse(value);
5249

src/Server/Coderr.Server.ReportAnalyzer/Inbound/Handlers/Reports/ReportAnalyzer.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
using System;
22
using System.Diagnostics;
33
using System.Linq;
4-
using System.Threading;
54
using System.Threading.Tasks;
65
using Coderr.Server.Abstractions.Boot;
76
using Coderr.Server.Domain.Core.ErrorReports;
8-
using Coderr.Server.Domain.Core.Incidents;
97
using Coderr.Server.Domain.Core.Incidents.Events;
10-
using Coderr.Server.Abstractions.Boot;
118
using Coderr.Server.ReportAnalyzer.Abstractions;
12-
using Coderr.Server.ReportAnalyzer.Abstractions.Boot;
139
using Coderr.Server.ReportAnalyzer.Abstractions.ErrorReports;
1410
using Coderr.Server.ReportAnalyzer.Abstractions.Incidents;
1511
using Coderr.Server.ReportAnalyzer.ErrorReports;

src/Server/Coderr.Server.ReportAnalyzer/ReportSpikes/Handlers/CheckForReportPeak.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
using Coderr.Server.Domain.Modules.ReportSpikes;
1010
using Coderr.Server.Domain.Modules.UserNotifications;
1111
using Coderr.Server.Infrastructure.Configuration;
12-
using Coderr.Server.Abstractions.Boot;
1312
using Coderr.Server.ReportAnalyzer.Abstractions.Incidents;
1413
using DotNetCqs;
15-
using Coderr.Server.ReportAnalyzer.Abstractions.Boot;
1614

1715
namespace Coderr.Server.ReportAnalyzer.ReportSpikes.Handlers
1816
{

src/Server/Coderr.Server.ReportAnalyzer/Tagging/Identifiers/AdoNetIdentifier.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using Coderr.Server.Abstractions.Boot;
3-
using Coderr.Server.Abstractions.Boot;
43

54
namespace Coderr.Server.ReportAnalyzer.Tagging.Identifiers
65
{

0 commit comments

Comments
 (0)