Skip to content

Commit 09b7ad2

Browse files
authored
Update to Paramore.Brighter 10.0.1 (#305)
1 parent e4b5043 commit 09b7ad2

30 files changed

Lines changed: 382 additions & 125 deletions

readme.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,27 @@ Will result in:
8787
<a id='snippet-Tests.HandlerTest.verified.txt'></a>
8888
```txt
8989
{
90-
Send: MyCommand: {
91-
Property: Some data
90+
Send: SendRecord: {
91+
Request: {
92+
Property: Some data,
93+
Id: {
94+
Value: Guid_1
95+
}
96+
},
97+
ContinueOnCapturedContext: true
9298
},
93-
Publish: MyEvent: {
94-
Property: Some other data
99+
Publish: PublishRecord: {
100+
Request: {
101+
Property: Some other data,
102+
Id: {
103+
Value: Guid_2
104+
}
105+
},
106+
ContinueOnCapturedContext: true
95107
}
96108
}
97109
```
98-
<sup><a href='/src/Tests/Tests.HandlerTest.verified.txt#L1-L8' title='Snippet source file'>snippet source</a> | <a href='#snippet-Tests.HandlerTest.verified.txt' title='Start of snippet'>anchor</a></sup>
110+
<sup><a href='/src/Tests/Tests.HandlerTest.verified.txt#L1-L20' title='Snippet source file'>snippet source</a> | <a href='#snippet-Tests.HandlerTest.verified.txt' title='Start of snippet'>anchor</a></sup>
99111
<!-- endSnippet -->
100112

101113

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
<Project>
33
<PropertyGroup>
4-
<Version>1.1.0</Version>
4+
<Version>2.0.0</Version>
55
<AssemblyVersion>1.0.0</AssemblyVersion>
66
<LangVersion>preview</LangVersion>
77
<PackageTags>Brighter, Verify</PackageTags>

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PackageVersion Include="MarkdownSnippets.MsBuild" Version="28.0.0-beta.2" />
88
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
99
<PackageVersion Include="ProjectDefaults" Version="1.0.161" />
10-
<PackageVersion Include="Paramore.Brighter" Version="9.9.12" />
10+
<PackageVersion Include="Paramore.Brighter" Version="10.0.1" />
1111
<PackageVersion Include="Verify" Version="31.0.1" />
1212
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
1313
<PackageVersion Include="Verify.XunitV3" Version="31.0.1" />

src/Tests/Message.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
public record Message(string Property) :
22
IRequest
33
{
4-
public Guid Id { get; set; } = Guid.NewGuid();
4+
public Id? CorrelationId { get; set; }
5+
public Id Id { get; set; } = Id.Random();
56
public Activity? Span { get; set; }
67
}

src/Tests/Request.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
public record Request(string Property) :
22
IRequest
33
{
4-
public Guid Id { get; set; }
4+
public Id Id { get; set; } = Id.Random();
55
public Activity Span { get; set; } = null!;
6+
public Id? CorrelationId { get; set; }
67
}

src/Tests/Response.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
public record Response(string Property) :
22
IResponse
33
{
4-
public Guid Id { get; set; }
4+
public Id Id { get; set; } = Id.Random();
55
public Activity? Span { get; set; }
6-
public Guid CorrelationId { get; set; }
6+
public Id? CorrelationId { get; set; }
77
}
88

99
public record MyCommand(string Property) :
1010
IResponse
1111
{
12-
public Guid Id { get; set; }
12+
public Id Id { get; set; } = Id.Random();
1313
public Activity? Span { get; set; }
14-
public Guid CorrelationId { get; set; }
14+
public Id? CorrelationId { get; set; }
1515
}
1616

1717
public record MyEvent(string Property) :
1818
IEvent
1919
{
20-
public Guid Id { get; set; }
20+
public Id Id { get; set; } = Id.Random();
2121
public Activity? Span { get; set; }
22+
public Id? CorrelationId { get; set; }
2223
}
Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
{
2-
Send: Response: {
3-
Property: Send Value
2+
Send: SendRecord: {
3+
Request: {
4+
Property: Send Value,
5+
Id: {
6+
Value: Guid_1
7+
}
8+
}
49
},
5-
Post: Response: {
6-
Property: Post Value
10+
Publish: PostRecord: {
11+
Request: {
12+
Property: Post Value,
13+
Id: {
14+
Value: Guid_2
15+
}
16+
}
717
},
8-
Publish: Response: {
9-
Property: Publish Value
18+
Publish: PublishRecord: {
19+
Request: {
20+
Property: Publish Value,
21+
Id: {
22+
Value: Guid_3
23+
}
24+
}
1025
},
11-
Deposit: Response: {
12-
Property: Publish Value
13-
},
14-
Clear Outbox: {
15-
AmountToClear: 100,
16-
MinimumAge: 5000,
17-
UseBulk: false
26+
Deposit: DepositPostRecord: {
27+
Requests: [
28+
{
29+
Property: Publish Value,
30+
Id: {
31+
Value: Guid_4
32+
}
33+
}
34+
]
1835
},
36+
Clear Outbox: {},
1937
Call: {
20-
Request: {},
38+
Request: {
39+
Id: {
40+
Value: Guid_5
41+
}
42+
},
2143
ResponseType: Response,
22-
TimeOut: 10 ms
44+
TimeOut: 01:00:00
2345
}
2446
}
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
{
2-
Send: MyCommand: {
3-
Property: Some data
2+
Send: SendRecord: {
3+
Request: {
4+
Property: Some data,
5+
Id: {
6+
Value: Guid_1
7+
}
8+
},
9+
ContinueOnCapturedContext: true
410
},
5-
Publish: MyEvent: {
6-
Property: Some other data
11+
Publish: PublishRecord: {
12+
Request: {
13+
Property: Some other data,
14+
Id: {
15+
Value: Guid_2
16+
}
17+
},
18+
ContinueOnCapturedContext: true
719
}
820
}

src/Tests/Tests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,17 @@ public override Task<Message> HandleAsync(Message message, Cancel cancel = defau
5454
processor.Post(new Response("Post Value"));
5555
processor.Publish(new Response("Publish Value"));
5656
processor.DepositPost(new Response("Publish Value"));
57-
processor.ClearOutbox();
58-
processor.Call<Call, Response>(new Call(), 10);
57+
processor.ClearOutbox([]);
58+
processor.Call<Call, Response>(new Call(), null, TimeSpan.FromHours(1));
5959
return base.HandleAsync(message);
6060
}
6161
}
6262

6363
public class Call :
6464
ICall
6565
{
66-
public Guid Id { get; set; }
66+
public Id? CorrelationId { get; set; }
67+
public Id Id { get; set; } = Id.Random();
6768
public Activity Span { get; set; } = null!;
6869
public ReplyAddress ReplyAddress { get; } = null!;
6970
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
namespace VerifyTests.Brighter;
22

3-
public record CallRecord(ICall Request, Type ResponseType, int TimeOutInMilliseconds);
3+
public record CallRecord(ICall Request, RequestContext? Context, Type ResponseType, TimeSpan? TimeOut);

0 commit comments

Comments
 (0)