-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reserved fields to proto generator
- Loading branch information
1 parent
fe2fe81
commit d348056
Showing
6 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Abc.Zebus.MessageDsl.Tests/MessageDsl/ReservationRangeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Abc.Zebus.MessageDsl.Analysis; | ||
using Abc.Zebus.MessageDsl.Tests.TestTools; | ||
using NUnit.Framework; | ||
|
||
namespace Abc.Zebus.MessageDsl.Tests.MessageDsl; | ||
|
||
[TestFixture] | ||
public class ReservationRangeTests | ||
{ | ||
[Test] | ||
public void should_compress_ranges() | ||
{ | ||
ReservationRange.Compress([new(2, 4), new(3, 5), new(6, 7), new(10, 12)]) | ||
.ShouldEqual([new(2, 7), new(10, 12)]); | ||
|
||
ReservationRange.Compress([]).ShouldEqual([]); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ests/MessageDsl/Snapshots/ProtoGeneratorTests.should_generate_reservations.verified.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
// Generated by Abc.Zebus.MessageDsl v1.2.3.4 | ||
|
||
import "servicebus.proto"; | ||
|
||
message MsgA { | ||
option (servicebus.message).type = Event; | ||
|
||
reserved 2, 8 to 16, 42; | ||
optional int32 Foo = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters