Skip to content

Commit 8e9a4e2

Browse files
committed
Merge branch 'develop'
2 parents 411ccf6 + 1f44061 commit 8e9a4e2

File tree

654 files changed

+2165
-1351
lines changed

Some content is hidden

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

654 files changed

+2165
-1351
lines changed

EventFlow.sln

+44-25
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,81 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.6
4+
VisualStudioVersion = 15.0.26730.12
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow", "Source\EventFlow\EventFlow.csproj", "{11131251-778D-4D2E-BDD1-4844A789BCA9}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow", "Source\EventFlow\EventFlow.csproj", "{11131251-778D-4D2E-BDD1-4844A789BCA9}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MSSQL", "MSSQL", "{E4FC24C0-3EB3-4203-B4F2-0B534B42574A}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Tests", "Source\EventFlow.Tests\EventFlow.Tests.csproj", "{7747E4A0-B378-46B6-837D-5E78C497B061}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Tests", "Source\EventFlow.Tests\EventFlow.Tests.csproj", "{7747E4A0-B378-46B6-837D-5E78C497B061}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.MsSql.Tests", "Source\EventFlow.MsSql.Tests\EventFlow.MsSql.Tests.csproj", "{A6F6232B-764F-4428-9EB5-CC98BE4F5E90}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.MsSql.Tests", "Source\EventFlow.MsSql.Tests\EventFlow.MsSql.Tests.csproj", "{A6F6232B-764F-4428-9EB5-CC98BE4F5E90}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Owin", "Source\EventFlow.Owin\EventFlow.Owin.csproj", "{EE6F7B78-3EF1-488F-B90A-8E7F350B7D51}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Owin", "Source\EventFlow.Owin\EventFlow.Owin.csproj", "{EE6F7B78-3EF1-488F-B90A-8E7F350B7D51}"
1515
EndProject
1616
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Owin", "Owin", "{9876C758-0A72-400E-A1B1-685E1C22ACB2}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Owin.Tests", "Source\EventFlow.Owin.Tests\EventFlow.Owin.Tests.csproj", "{2F3A5BCA-5336-4BB1-BA3D-0FEEA78C0415}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Owin.Tests", "Source\EventFlow.Owin.Tests\EventFlow.Owin.Tests.csproj", "{2F3A5BCA-5336-4BB1-BA3D-0FEEA78C0415}"
1919
EndProject
20-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.TestHelpers", "Source\EventFlow.TestHelpers\EventFlow.TestHelpers.csproj", "{571D291C-5E4C-43AF-855F-7C4E2F318F4C}"
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.TestHelpers", "Source\EventFlow.TestHelpers\EventFlow.TestHelpers.csproj", "{571D291C-5E4C-43AF-855F-7C4E2F318F4C}"
2121
EndProject
22-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Autofac", "Source\EventFlow.Autofac\EventFlow.Autofac.csproj", "{26F06682-3364-4C22-B9B2-2F2653D0BE0D}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Autofac", "Source\EventFlow.Autofac\EventFlow.Autofac.csproj", "{26F06682-3364-4C22-B9B2-2F2653D0BE0D}"
2323
EndProject
2424
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventStore", "EventStore", "{F6D62A27-50EA-4846-8F36-F3D36F52DCA6}"
2525
EndProject
26-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.EventStores.EventStore", "Source\EventFlow.EventStores.EventStore\EventFlow.EventStores.EventStore.csproj", "{E42A253D-2011-4799-B55D-1D0C61E171C2}"
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.EventStores.EventStore", "Source\EventFlow.EventStores.EventStore\EventFlow.EventStores.EventStore.csproj", "{E42A253D-2011-4799-B55D-1D0C61E171C2}"
2727
EndProject
28-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.EventStores.EventStore.Tests", "Source\EventFlow.EventStores.EventStore.Tests\EventFlow.EventStores.EventStore.Tests.csproj", "{BC4F0E41-6659-4D6D-9D25-1558CBA1649B}"
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.EventStores.EventStore.Tests", "Source\EventFlow.EventStores.EventStore.Tests\EventFlow.EventStores.EventStore.Tests.csproj", "{BC4F0E41-6659-4D6D-9D25-1558CBA1649B}"
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RabbitMQ", "RabbitMQ", "{7951DC73-5DAF-4322-9AF0-099BF5C90837}"
3131
EndProject
32-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.RabbitMQ", "Source\EventFlow.RabbitMQ\EventFlow.RabbitMQ.csproj", "{4B06F01F-ACE6-489D-A92A-012F533EFA3C}"
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.RabbitMQ", "Source\EventFlow.RabbitMQ\EventFlow.RabbitMQ.csproj", "{4B06F01F-ACE6-489D-A92A-012F533EFA3C}"
3333
EndProject
34-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.RabbitMQ.Tests", "Source\EventFlow.RabbitMQ.Tests\EventFlow.RabbitMQ.Tests.csproj", "{BC96BEAE-E84E-4C51-B66D-DA1F43EAD54A}"
34+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.RabbitMQ.Tests", "Source\EventFlow.RabbitMQ.Tests\EventFlow.RabbitMQ.Tests.csproj", "{BC96BEAE-E84E-4C51-B66D-DA1F43EAD54A}"
3535
EndProject
3636
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Autofac", "Autofac", "{980EEDAA-1FEF-4D7C-8811-5EF1D9729773}"
3737
EndProject
3838
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hangfire", "Hangfire", "{4741A405-DA64-40CC-A726-A2C48CA49DA3}"
3939
EndProject
40-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Hangfire", "Source\EventFlow.Hangfire\EventFlow.Hangfire.csproj", "{FB079985-722A-43C9-9F14-C7D2AFBE8826}"
40+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Hangfire", "Source\EventFlow.Hangfire\EventFlow.Hangfire.csproj", "{FB079985-722A-43C9-9F14-C7D2AFBE8826}"
4141
EndProject
42-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Hangfire.Tests", "Source\EventFlow.Hangfire.Tests\EventFlow.Hangfire.Tests.csproj", "{35180FC7-9135-4E79-8643-0FB825B40871}"
42+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Hangfire.Tests", "Source\EventFlow.Hangfire.Tests\EventFlow.Hangfire.Tests.csproj", "{35180FC7-9135-4E79-8643-0FB825B40871}"
4343
EndProject
4444
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elasticsearch", "Elasticsearch", "{D6F5FF86-C3F3-443D-BEC4-11BDEC5E34FB}"
4545
EndProject
4646
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{7F20CC09-6988-40BC-8693-80E0F7022926}"
4747
EndProject
48-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Examples.Shipping", "Source\EventFlow.Examples.Shipping\EventFlow.Examples.Shipping.csproj", "{B07DD7F2-68EE-4BC7-8E37-E84BFA3F5B39}"
48+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Examples.Shipping", "Source\EventFlow.Examples.Shipping\EventFlow.Examples.Shipping.csproj", "{B07DD7F2-68EE-4BC7-8E37-E84BFA3F5B39}"
4949
EndProject
50-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Examples.Shipping.Queries.InMemory", "Source\EventFlow.Examples.Shipping.Queries.InMemory\EventFlow.Examples.Shipping.Queries.InMemory.csproj", "{079DC9A6-7740-476A-BC4F-D74D8D7A32AC}"
50+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Examples.Shipping.Queries.InMemory", "Source\EventFlow.Examples.Shipping.Queries.InMemory\EventFlow.Examples.Shipping.Queries.InMemory.csproj", "{079DC9A6-7740-476A-BC4F-D74D8D7A32AC}"
5151
EndProject
52-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Examples.Shipping.Tests", "Source\EventFlow.Examples.Shipping.Tests\EventFlow.Examples.Shipping.Tests.csproj", "{A6F9C84B-27F6-4179-9768-4AA2099405FC}"
52+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Examples.Shipping.Tests", "Source\EventFlow.Examples.Shipping.Tests\EventFlow.Examples.Shipping.Tests.csproj", "{A6F9C84B-27F6-4179-9768-4AA2099405FC}"
5353
EndProject
5454
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLite", "SQLite", "{2A71452E-15DD-4EBA-A7A1-8CC3D298097D}"
5555
EndProject
5656
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQL", "SQL", "{92F3C263-8C0C-4D12-B41A-452E48D2E5E8}"
5757
EndProject
58-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Sql", "Source\EventFlow.Sql\EventFlow.Sql.csproj", "{8EC9D877-7351-4C7E-87A8-29BBD3D7FEBB}"
58+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Sql", "Source\EventFlow.Sql\EventFlow.Sql.csproj", "{8EC9D877-7351-4C7E-87A8-29BBD3D7FEBB}"
5959
EndProject
60-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.MsSql", "Source\EventFlow.MsSql\EventFlow.MsSql.csproj", "{A0C8E77F-DB74-4035-B0DE-9BADDFCA5EBE}"
60+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.MsSql", "Source\EventFlow.MsSql\EventFlow.MsSql.csproj", "{A0C8E77F-DB74-4035-B0DE-9BADDFCA5EBE}"
6161
EndProject
62-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.SQLite", "Source\EventFlow.SQLite\EventFlow.SQLite.csproj", "{CEE8E914-B31C-4AAA-B520-CF72560D90FA}"
62+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.SQLite", "Source\EventFlow.SQLite\EventFlow.SQLite.csproj", "{CEE8E914-B31C-4AAA-B520-CF72560D90FA}"
6363
EndProject
64-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.SQLite.Tests", "Source\EventFlow.SQLite.Tests\EventFlow.SQLite.Tests.csproj", "{E81D3BA7-E9C9-4227-840E-7B84ED6302C6}"
64+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.SQLite.Tests", "Source\EventFlow.SQLite.Tests\EventFlow.SQLite.Tests.csproj", "{E81D3BA7-E9C9-4227-840E-7B84ED6302C6}"
6565
EndProject
66-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Sql.Tests", "Source\EventFlow.Sql.Tests\EventFlow.Sql.Tests.csproj", "{36F59228-C7DC-4799-8342-4CAF5C4E95D5}"
66+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Sql.Tests", "Source\EventFlow.Sql.Tests\EventFlow.Sql.Tests.csproj", "{36F59228-C7DC-4799-8342-4CAF5C4E95D5}"
6767
EndProject
68-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Elasticsearch", "Source\EventFlow.Elasticsearch\EventFlow.Elasticsearch.csproj", "{404C6099-E82F-4433-8505-5479D76660CD}"
68+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Elasticsearch", "Source\EventFlow.Elasticsearch\EventFlow.Elasticsearch.csproj", "{404C6099-E82F-4433-8505-5479D76660CD}"
6969
EndProject
70-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Elasticsearch.Tests", "Source\EventFlow.Elasticsearch.Tests\EventFlow.Elasticsearch.Tests.csproj", "{D4D7E41C-1473-4449-A128-CA4383783E6C}"
70+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Elasticsearch.Tests", "Source\EventFlow.Elasticsearch.Tests\EventFlow.Elasticsearch.Tests.csproj", "{D4D7E41C-1473-4449-A128-CA4383783E6C}"
7171
EndProject
72-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.Autofac.Tests", "Source\EventFlow.Autofac.Tests\EventFlow.Autofac.Tests.csproj", "{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5}"
72+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.Autofac.Tests", "Source\EventFlow.Autofac.Tests\EventFlow.Autofac.Tests.csproj", "{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5}"
73+
EndProject
74+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AspNetCore", "AspNetCore", "{3A34F6A2-64B0-4730-A0EB-D324BC755538}"
75+
EndProject
76+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.AspNetCore", "Source\EventFlow.AspNetCore\EventFlow.AspNetCore.csproj", "{9D57E096-AA8E-40E5-A1CC-32C07B425850}"
77+
EndProject
78+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventFlow.AspNetCore.Tests", "Source\EventFlow.AspNetCore.Tests\EventFlow.AspNetCore.Tests.csproj", "{C16B0B27-6E6C-439C-8419-488B2D4D798F}"
7379
EndProject
7480
Global
7581
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -173,6 +179,14 @@ Global
173179
{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
174180
{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
175181
{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5}.Release|Any CPU.Build.0 = Release|Any CPU
182+
{9D57E096-AA8E-40E5-A1CC-32C07B425850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
183+
{9D57E096-AA8E-40E5-A1CC-32C07B425850}.Debug|Any CPU.Build.0 = Debug|Any CPU
184+
{9D57E096-AA8E-40E5-A1CC-32C07B425850}.Release|Any CPU.ActiveCfg = Release|Any CPU
185+
{9D57E096-AA8E-40E5-A1CC-32C07B425850}.Release|Any CPU.Build.0 = Release|Any CPU
186+
{C16B0B27-6E6C-439C-8419-488B2D4D798F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
187+
{C16B0B27-6E6C-439C-8419-488B2D4D798F}.Debug|Any CPU.Build.0 = Debug|Any CPU
188+
{C16B0B27-6E6C-439C-8419-488B2D4D798F}.Release|Any CPU.ActiveCfg = Release|Any CPU
189+
{C16B0B27-6E6C-439C-8419-488B2D4D798F}.Release|Any CPU.Build.0 = Release|Any CPU
176190
EndGlobalSection
177191
GlobalSection(SolutionProperties) = preSolution
178192
HideSolutionNode = FALSE
@@ -201,5 +215,10 @@ Global
201215
{404C6099-E82F-4433-8505-5479D76660CD} = {D6F5FF86-C3F3-443D-BEC4-11BDEC5E34FB}
202216
{D4D7E41C-1473-4449-A128-CA4383783E6C} = {D6F5FF86-C3F3-443D-BEC4-11BDEC5E34FB}
203217
{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5} = {980EEDAA-1FEF-4D7C-8811-5EF1D9729773}
218+
{9D57E096-AA8E-40E5-A1CC-32C07B425850} = {3A34F6A2-64B0-4730-A0EB-D324BC755538}
219+
{C16B0B27-6E6C-439C-8419-488B2D4D798F} = {3A34F6A2-64B0-4730-A0EB-D324BC755538}
220+
EndGlobalSection
221+
GlobalSection(ExtensibilityGlobals) = postSolution
222+
SolutionGuid = {17607E2C-4E8E-45A2-85BD-0A5808E1C0F3}
204223
EndGlobalSection
205224
EndGlobal

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2017 Rasmus Mikkelsen
4-
Copyright (c) 2015-2017 eBay Software Foundation
3+
Copyright (c) 2015-2018 Rasmus Mikkelsen
4+
Copyright (c) 2015-2018 eBay Software Foundation
55
https://github.com/eventflow/EventFlow
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ to the documentation.
7373
* [**Event store:**](http://docs.geteventflow.net/EventStore.html)
7474
Storage of the event stream for aggregates. Currently there is support for
7575
these storage types.
76-
* In-memory - only for test
77-
* Files - only for test
78-
* Microsoft SQL Server
79-
* EventStore - only for test (for now) [home page](https://geteventstore.com/)
76+
* In-memory - only for test
77+
* Files - only for test
78+
* Microsoft SQL Server
79+
* EventStore - only for test (for now) [home page](https://geteventstore.com/)
8080
* [**Subscribers:**](http://docs.geteventflow.net/Subscribers.html)
8181
Listeners that act on specific domain events. Useful if an specific action
8282
needs to be triggered after a domain event has been committed.
@@ -358,8 +358,8 @@ category.
358358
```
359359
The MIT License (MIT)
360360
361-
Copyright (c) 2015-2017 Rasmus Mikkelsen
362-
Copyright (c) 2015-2017 eBay Software Foundation
361+
Copyright (c) 2015-2018 Rasmus Mikkelsen
362+
Copyright (c) 2015-2018 eBay Software Foundation
363363
https://github.com/eventflow/EventFlow
364364
365365
Permission is hereby granted, free of charge, to any person obtaining a copy

RELEASE_NOTES.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
### New in 0.52 (not released yet)
1+
### New in 0.53 (not released yet)
2+
3+
* New: Allow events to have multiple `EventVersion` attributes
4+
* Fixed: `ReflectionHelper.CompileMethodInvocation` now recognises
5+
`private` methods.
6+
7+
### New in 0.52.3178 (released 2017-11-02)
28

39
* Fixed: `.UseFilesEventStore` now uses a thread safe singleton instance for
410
file system persistence, making it suitable for use in multi-threaded unit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net461</TargetFramework>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
13+
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
14+
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\EventFlow.AspNetCore\EventFlow.AspNetCore.csproj" />
19+
<ProjectReference Include="..\EventFlow.Autofac\EventFlow.Autofac.csproj" />
20+
<ProjectReference Include="..\EventFlow.TestHelpers\EventFlow.TestHelpers.csproj" />
21+
</ItemGroup>
22+
23+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// The MIT License (MIT)
2+
//
3+
// Copyright (c) 2015-2018 Rasmus Mikkelsen
4+
// Copyright (c) 2015-2018 eBay Software Foundation
5+
// https://github.com/eventflow/EventFlow
6+
//
7+
// Permission is hereby granted, free of charge, to any person obtaining a copy of
8+
// this software and associated documentation files (the "Software"), to deal in
9+
// the Software without restriction, including without limitation the rights to
10+
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11+
// the Software, and to permit persons to whom the Software is furnished to do so,
12+
// subject to the following conditions:
13+
//
14+
// The above copyright notice and this permission notice shall be included in all
15+
// copies or substantial portions of the Software.
16+
//
17+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19+
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20+
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21+
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23+
24+
using System.Net.Http;
25+
using System.Text;
26+
using System.Threading.Tasks;
27+
using EventFlow.Logs;
28+
using EventFlow.TestHelpers;
29+
using EventFlow.TestHelpers.Aggregates.Commands;
30+
using Microsoft.AspNetCore.Hosting;
31+
using Microsoft.AspNetCore.TestHost;
32+
using Newtonsoft.Json;
33+
using NUnit.Framework;
34+
35+
namespace EventFlow.AspNetCore.Tests.IntegrationTests.Site
36+
{
37+
[Category(Categories.Integration)]
38+
public class SiteTests : Test
39+
{
40+
private TestServer _server;
41+
private HttpClient _client;
42+
private ConsoleLog _log;
43+
44+
[SetUp]
45+
public void SetUp()
46+
{
47+
_server = new TestServer(new WebHostBuilder()
48+
.UseStartup<Startup>());
49+
_client = _server.CreateClient();
50+
_log = new ConsoleLog();
51+
}
52+
53+
[TearDown]
54+
public void TearDown()
55+
{
56+
_server.Dispose();
57+
}
58+
59+
[Test]
60+
public async Task Ping()
61+
{
62+
// Act
63+
await GetAsync("thingy/ping?id=thingy-d15b1562-11f2-4645-8b1a-f8b946b566d3").ConfigureAwait(false);
64+
await GetAsync("thingy/ping?id=thingy-d15b1562-11f2-4645-8b1a-f8b946b566d3").ConfigureAwait(false);
65+
}
66+
67+
[Test]
68+
public async Task PublishCommand()
69+
{
70+
// Arrange
71+
var pingCommand = A<ThingyPingCommand>();
72+
73+
// Act
74+
await PostAsync("commands/ThingyPing/1", pingCommand).ConfigureAwait(false);
75+
}
76+
77+
private async Task<string> GetAsync(string url)
78+
{
79+
// Act
80+
var response = await _client.GetAsync(url);
81+
82+
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
83+
84+
85+
_log.Information(
86+
"Received a '{0}' from '{1}' with this content: {2}",
87+
response.StatusCode,
88+
response.RequestMessage.RequestUri,
89+
content);
90+
91+
response.EnsureSuccessStatusCode();
92+
93+
return content;
94+
}
95+
96+
private async Task<string> PostAsync(string url, object obj)
97+
{
98+
var json = JsonConvert.SerializeObject(obj);
99+
var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
100+
101+
var response = await _client.PostAsync(url, stringContent);
102+
103+
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
104+
105+
_log.Information(
106+
"Received a '{0}' from '{1}' with this content: {2}",
107+
response.StatusCode,
108+
response.RequestMessage.RequestUri,
109+
content);
110+
111+
response.EnsureSuccessStatusCode();
112+
113+
return content;
114+
}
115+
}
116+
}

0 commit comments

Comments
 (0)