Skip to content

Commit da2dec9

Browse files
authored
Merge pull request #11 from hlaueriksson/Threedotoh
Threedotoh
2 parents 9376121 + c93a96e commit da2dec9

144 files changed

Lines changed: 338 additions & 2376 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ dotnet_diagnostic.CA1054.severity = none
179179
dotnet_diagnostic.CA1848.severity = none
180180
dotnet_diagnostic.SA1101.severity = none
181181
dotnet_diagnostic.SA1309.severity = none
182+
dotnet_diagnostic.SA1402.severity = none
182183
dotnet_diagnostic.SA1623.severity = none
183184
dotnet_diagnostic.SA1625.severity = none
184185
dotnet_diagnostic.SA1633.severity = none

Analyzers.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
</AdditionalFiles>
1313
</ItemGroup>
1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.2.32">
15+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.4.33">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="Roslynator.Analyzers" Version="4.1.0">
19+
<PackageReference Include="Roslynator.Analyzers" Version="4.2.0">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>

CommandQuery.Samples.sln

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.Client"
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.Handlers", "samples\CommandQuery.Sample.Handlers\CommandQuery.Sample.Handlers.csproj", "{4A4F9ADD-F1CD-4377-8274-511C5221A87F}"
1515
EndProject
16-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AspNetCore.V3", "samples\CommandQuery.Sample.AspNetCore.V3\CommandQuery.Sample.AspNetCore.V3.csproj", "{CEE17B08-1F7A-4E19-8E2A-047CF9E26E6C}"
17-
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AspNetCore.V3.Tests", "samples\CommandQuery.Sample.AspNetCore.V3.Tests\CommandQuery.Sample.AspNetCore.V3.Tests.csproj", "{73D683B9-3429-41A7-96D5-C72BA63B3D00}"
19-
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AzureFunctions.V3", "samples\CommandQuery.Sample.AzureFunctions.V3\CommandQuery.Sample.AzureFunctions.V3.csproj", "{9F7DE946-CAD3-40A1-A9F3-086D2BA6F1BB}"
21-
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AzureFunctions.V3.Tests", "samples\CommandQuery.Sample.AzureFunctions.V3.Tests\CommandQuery.Sample.AzureFunctions.V3.Tests.csproj", "{C501E086-8F0B-4212-B9C3-AFBA870DF33A}"
23-
EndProject
2416
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.GoogleCloudFunctions", "samples\CommandQuery.Sample.GoogleCloudFunctions\CommandQuery.Sample.GoogleCloudFunctions.csproj", "{1DD7928F-24E7-4D21-BE69-39065CDAA5F7}"
2517
EndProject
2618
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.GoogleCloudFunctions.Tests", "samples\CommandQuery.Sample.GoogleCloudFunctions.Tests\CommandQuery.Sample.GoogleCloudFunctions.Tests.csproj", "{20A4BF7B-F8B0-4CD6-BB63-F34338B95CD8}"
@@ -29,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AspNetC
2921
EndProject
3022
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AspNetCore.V6.Tests", "samples\CommandQuery.Sample.AspNetCore.V6.Tests\CommandQuery.Sample.AspNetCore.V6.Tests.csproj", "{9499162C-FA52-4625-9628-B86952ED85C5}"
3123
EndProject
32-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandQuery.Sample.AzureFunctions.V6", "samples\CommandQuery.Sample.AzureFunctions.V6\CommandQuery.Sample.AzureFunctions.V6.csproj", "{06C6F925-BACD-4F1F-8905-7F787330E980}"
24+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AzureFunctions.V6", "samples\CommandQuery.Sample.AzureFunctions.V6\CommandQuery.Sample.AzureFunctions.V6.csproj", "{06C6F925-BACD-4F1F-8905-7F787330E980}"
3325
EndProject
3426
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Sample.AzureFunctions.V6.Tests", "samples\CommandQuery.Sample.AzureFunctions.V6.Tests\CommandQuery.Sample.AzureFunctions.V6.Tests.csproj", "{2D223ADD-F2C9-4DB7-A68D-B04965AB2060}"
3527
EndProject
@@ -59,22 +51,6 @@ Global
5951
{4A4F9ADD-F1CD-4377-8274-511C5221A87F}.Debug|Any CPU.Build.0 = Debug|Any CPU
6052
{4A4F9ADD-F1CD-4377-8274-511C5221A87F}.Release|Any CPU.ActiveCfg = Release|Any CPU
6153
{4A4F9ADD-F1CD-4377-8274-511C5221A87F}.Release|Any CPU.Build.0 = Release|Any CPU
62-
{CEE17B08-1F7A-4E19-8E2A-047CF9E26E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63-
{CEE17B08-1F7A-4E19-8E2A-047CF9E26E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
64-
{CEE17B08-1F7A-4E19-8E2A-047CF9E26E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
65-
{CEE17B08-1F7A-4E19-8E2A-047CF9E26E6C}.Release|Any CPU.Build.0 = Release|Any CPU
66-
{73D683B9-3429-41A7-96D5-C72BA63B3D00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67-
{73D683B9-3429-41A7-96D5-C72BA63B3D00}.Debug|Any CPU.Build.0 = Debug|Any CPU
68-
{73D683B9-3429-41A7-96D5-C72BA63B3D00}.Release|Any CPU.ActiveCfg = Release|Any CPU
69-
{73D683B9-3429-41A7-96D5-C72BA63B3D00}.Release|Any CPU.Build.0 = Release|Any CPU
70-
{9F7DE946-CAD3-40A1-A9F3-086D2BA6F1BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
71-
{9F7DE946-CAD3-40A1-A9F3-086D2BA6F1BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
72-
{9F7DE946-CAD3-40A1-A9F3-086D2BA6F1BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
73-
{9F7DE946-CAD3-40A1-A9F3-086D2BA6F1BB}.Release|Any CPU.Build.0 = Release|Any CPU
74-
{C501E086-8F0B-4212-B9C3-AFBA870DF33A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75-
{C501E086-8F0B-4212-B9C3-AFBA870DF33A}.Debug|Any CPU.Build.0 = Debug|Any CPU
76-
{C501E086-8F0B-4212-B9C3-AFBA870DF33A}.Release|Any CPU.ActiveCfg = Release|Any CPU
77-
{C501E086-8F0B-4212-B9C3-AFBA870DF33A}.Release|Any CPU.Build.0 = Release|Any CPU
7854
{1DD7928F-24E7-4D21-BE69-39065CDAA5F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7955
{1DD7928F-24E7-4D21-BE69-39065CDAA5F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
8056
{1DD7928F-24E7-4D21-BE69-39065CDAA5F7}.Release|Any CPU.ActiveCfg = Release|Any CPU

CommandQuery.sln

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29503.13
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33205.214
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{382E6C39-5EF6-453D-88DC-9079E57A240E}"
77
EndProject
@@ -27,8 +27,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.AWSLambda.Test
2727
EndProject
2828
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.AzureFunctions.Tests", "tests\CommandQuery.AzureFunctions.Tests\CommandQuery.AzureFunctions.Tests.csproj", "{BE082150-6F58-41C6-96F1-00F4FD827F4A}"
2929
EndProject
30-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.NewtonsoftJson", "src\CommandQuery.NewtonsoftJson\CommandQuery.NewtonsoftJson.csproj", "{C14B2EDE-E313-400E-A53C-96787CBBD1C8}"
31-
EndProject
3230
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.SystemTextJson", "src\CommandQuery.SystemTextJson\CommandQuery.SystemTextJson.csproj", "{A9946B7C-FB24-4873-9D56-549716BA51FE}"
3331
EndProject
3432
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandQuery.Benchmark", "tests\CommandQuery.Benchmark\CommandQuery.Benchmark.csproj", "{55DAA02E-406A-41CC-89D7-CC97D71AA9CC}"
@@ -85,10 +83,6 @@ Global
8583
{BE082150-6F58-41C6-96F1-00F4FD827F4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
8684
{BE082150-6F58-41C6-96F1-00F4FD827F4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
8785
{BE082150-6F58-41C6-96F1-00F4FD827F4A}.Release|Any CPU.Build.0 = Release|Any CPU
88-
{C14B2EDE-E313-400E-A53C-96787CBBD1C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
89-
{C14B2EDE-E313-400E-A53C-96787CBBD1C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
90-
{C14B2EDE-E313-400E-A53C-96787CBBD1C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
91-
{C14B2EDE-E313-400E-A53C-96787CBBD1C8}.Release|Any CPU.Build.0 = Release|Any CPU
9286
{A9946B7C-FB24-4873-9D56-549716BA51FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
9387
{A9946B7C-FB24-4873-9D56-549716BA51FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
9488
{A9946B7C-FB24-4873-9D56-549716BA51FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -124,7 +118,6 @@ Global
124118
{FB355BA1-6923-4894-9BA2-B471A23EC3F5} = {4875335E-26C1-4D2A-80E9-4362C823DF3B}
125119
{F81EEC3B-BB3D-456F-942B-6F610F977F53} = {4875335E-26C1-4D2A-80E9-4362C823DF3B}
126120
{BE082150-6F58-41C6-96F1-00F4FD827F4A} = {4875335E-26C1-4D2A-80E9-4362C823DF3B}
127-
{C14B2EDE-E313-400E-A53C-96787CBBD1C8} = {382E6C39-5EF6-453D-88DC-9079E57A240E}
128121
{A9946B7C-FB24-4873-9D56-549716BA51FE} = {382E6C39-5EF6-453D-88DC-9079E57A240E}
129122
{55DAA02E-406A-41CC-89D7-CC97D71AA9CC} = {4875335E-26C1-4D2A-80E9-4362C823DF3B}
130123
{361CA3A1-4E20-4C3F-AAE8-F059E533522E} = {382E6C39-5EF6-453D-88DC-9079E57A240E}

nuget-local.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ nuget init .\src\CommandQuery.AWSLambda\bin\Release\ .\packages
55
nuget init .\src\CommandQuery.AzureFunctions\bin\Release\ .\packages
66
nuget init .\src\CommandQuery.Client\bin\Release\ .\packages
77
nuget init .\src\CommandQuery.GoogleCloudFunctions\bin\Release\ .\packages
8-
nuget init .\src\CommandQuery.NewtonsoftJson\bin\Release\ .\packages
98
nuget init .\src\CommandQuery.SystemTextJson\bin\Release\ .\packages

samples/CommandQuery.Sample.AWSLambda.Tests/CommandQuery.Sample.AWSLambda.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
<ItemGroup>
99
<PackageReference Include="Amazon.Lambda.TestUtilities" Version="2.0.0" />
10-
<PackageReference Include="FluentAssertions" Version="6.6.0" />
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
10+
<PackageReference Include="FluentAssertions" Version="6.8.0" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
1212
<PackageReference Include="NUnit" Version="3.13.3" />
13-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
13+
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>

samples/CommandQuery.Sample.AWSLambda.Tests/CommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task should_handle_errors()
3232
result.ShouldBeError("The command type 'FailCommand' could not be found");
3333
}
3434

35-
APIGatewayProxyRequest GetRequest(string content) => new APIGatewayProxyRequest { Body = content };
35+
static APIGatewayProxyRequest GetRequest(string content) => new() { Body = content };
3636
}
3737
}
3838
}

samples/CommandQuery.Sample.AWSLambda.Tests/QueryTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void SetUp()
2525
public async Task should_work()
2626
{
2727
var result = await Subject.Handle(Request.QueryName("BarQuery"), Context);
28-
var value = result.As<Bar>();
28+
var value = result.As<Bar>()!;
2929

3030
value.Id.Should().Be(1);
3131
value.Value.Should().NotBeEmpty();
@@ -39,9 +39,9 @@ public async Task should_handle_errors()
3939
result.ShouldBeError("The query type 'FailQuery' could not be found");
4040
}
4141

42-
Query Subject;
43-
APIGatewayProxyRequest Request;
44-
ILambdaContext Context;
42+
Query Subject = null!;
43+
APIGatewayProxyRequest Request = null!;
44+
ILambdaContext Context = null!;
4545
}
4646

4747
public class when_using_the_real_function_via_Get
@@ -58,7 +58,7 @@ public void SetUp()
5858
public async Task should_work()
5959
{
6060
var result = await Subject.Handle(Request.QueryName("BarQuery"), Context);
61-
var value = result.As<Bar>();
61+
var value = result.As<Bar>()!;
6262

6363
value.Id.Should().Be(1);
6464
value.Value.Should().NotBeEmpty();
@@ -72,12 +72,12 @@ public async Task should_handle_errors()
7272
result.ShouldBeError("The query type 'FailQuery' could not be found");
7373
}
7474

75-
Query Subject;
76-
APIGatewayProxyRequest Request;
77-
ILambdaContext Context;
75+
Query Subject = null!;
76+
APIGatewayProxyRequest Request = null!;
77+
ILambdaContext Context = null!;
7878
}
7979

80-
static APIGatewayProxyRequest GetRequest(string method, string content = null, Dictionary<string, IList<string>> query = null)
80+
static APIGatewayProxyRequest GetRequest(string method, string? content = null, Dictionary<string, IList<string>>? query = null)
8181
{
8282
var request = new APIGatewayProxyRequest
8383
{

samples/CommandQuery.Sample.AWSLambda.Tests/ShouldExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static void ShouldBeError(this APIGatewayProxyResponse result, string mes
1111
{
1212
result.Should().NotBeNull();
1313
result.StatusCode.Should().NotBe(200);
14-
var value = JsonSerializer.Deserialize<Error>(result.Body);
14+
var value = JsonSerializer.Deserialize<Error>(result.Body)!;
1515
value.Should().NotBeNull();
1616
value.Message.Should().Be(message);
1717
}

samples/CommandQuery.Sample.AWSLambda.Tests/TestExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static APIGatewayProxyRequest CommandName(this APIGatewayProxyRequest req
2020
return request;
2121
}
2222

23-
public static T As<T>(this APIGatewayProxyResponse result)
23+
public static T? As<T>(this APIGatewayProxyResponse result)
2424
{
2525
return JsonSerializer.Deserialize<T>(result.Body);
2626
}

0 commit comments

Comments
 (0)