@@ -5,9 +5,12 @@ namespace KurrentDB.Client.Tests.Streams;
5
5
6
6
[ Trait ( "Category" , "Target:Streams" ) ]
7
7
[ Trait ( "Category" , "Operation:Delete" ) ]
8
- public class DeleteTests ( ITestOutputHelper output , KurrentDBPermanentFixture fixture ) : KurrentPermanentTests < KurrentDBPermanentFixture > ( output , fixture ) {
8
+ public class DeleteTests ( ITestOutputHelper output , KurrentDBPermanentFixture fixture )
9
+ : KurrentPermanentTests < KurrentDBPermanentFixture > ( output , fixture ) {
9
10
[ Theory , ExpectedStreamStateCases ]
10
- public async Task hard_deleting_a_stream_that_does_not_exist_with_expected_version_does_not_throw ( StreamState expectedVersion , string name ) {
11
+ public async Task hard_deleting_a_stream_that_does_not_exist_with_expected_version_does_not_throw (
12
+ StreamState expectedVersion , string name
13
+ ) {
11
14
var stream = $ "{ Fixture . GetStreamName ( ) } _{ name } ";
12
15
13
16
await Fixture . Streams . TombstoneAsync ( stream , expectedVersion ) ;
@@ -26,14 +29,18 @@ public async Task soft_deleting_a_stream_that_exists() {
26
29
public async Task hard_deleting_a_stream_that_does_not_exist_with_wrong_expected_version_throws ( ) {
27
30
var stream = Fixture . GetStreamName ( ) ;
28
31
29
- await Assert . ThrowsAsync < WrongExpectedVersionException > ( ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . StreamRevision ( 0 ) ) ) ;
32
+ await Assert . ThrowsAsync < WrongExpectedVersionException > (
33
+ ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . StreamRevision ( 0 ) )
34
+ ) ;
30
35
}
31
36
32
37
[ Fact ]
33
38
public async Task soft_deleting_a_stream_that_does_not_exist_with_wrong_expected_version_throws ( ) {
34
39
var stream = Fixture . GetStreamName ( ) ;
35
40
36
- await Assert . ThrowsAsync < WrongExpectedVersionException > ( ( ) => Fixture . Streams . DeleteAsync ( stream , StreamState . StreamRevision ( 0 ) ) ) ;
41
+ await Assert . ThrowsAsync < WrongExpectedVersionException > (
42
+ ( ) => Fixture . Streams . DeleteAsync ( stream , StreamState . StreamRevision ( 0 ) )
43
+ ) ;
37
44
}
38
45
39
46
[ Fact ]
@@ -72,13 +79,17 @@ public async Task hard_deleting_a_deleted_stream_should_throw() {
72
79
73
80
await Fixture . Streams . TombstoneAsync ( stream , StreamState . NoStream ) ;
74
81
75
- await Assert . ThrowsAsync < StreamDeletedException > ( ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . NoStream ) ) ;
82
+ await Assert . ThrowsAsync < StreamDeletedException > (
83
+ ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . NoStream )
84
+ ) ;
76
85
}
77
86
78
87
[ Fact ]
79
88
public async Task with_timeout_any_stream_revision_delete_fails_when_operation_expired ( ) {
80
- var stream = Fixture . GetStreamName ( ) ;
81
- var rpcException = await Assert . ThrowsAsync < RpcException > ( ( ) => Fixture . Streams . DeleteAsync ( stream , StreamState . Any , TimeSpan . Zero ) ) ;
89
+ var stream = Fixture . GetStreamName ( ) ;
90
+ var rpcException = await Assert . ThrowsAsync < RpcException > (
91
+ ( ) => Fixture . Streams . DeleteAsync ( stream , StreamState . Any , new DeleteOptions { Deadline = TimeSpan . Zero } )
92
+ ) ;
82
93
83
94
Assert . Equal ( StatusCode . DeadlineExceeded , rpcException . StatusCode ) ;
84
95
}
@@ -87,15 +98,23 @@ public async Task with_timeout_any_stream_revision_delete_fails_when_operation_e
87
98
public async Task with_timeout_stream_revision_delete_fails_when_operation_expired ( ) {
88
99
var stream = Fixture . GetStreamName ( ) ;
89
100
90
- var rpcException = await Assert . ThrowsAsync < RpcException > ( ( ) => Fixture . Streams . DeleteAsync ( stream , StreamState . StreamRevision ( 0 ) , TimeSpan . Zero ) ) ;
101
+ var rpcException = await Assert . ThrowsAsync < RpcException > (
102
+ ( ) => Fixture . Streams . DeleteAsync (
103
+ stream ,
104
+ StreamState . StreamRevision ( 0 ) ,
105
+ new DeleteOptions { Deadline = TimeSpan . Zero }
106
+ )
107
+ ) ;
91
108
92
109
Assert . Equal ( StatusCode . DeadlineExceeded , rpcException . StatusCode ) ;
93
110
}
94
111
95
112
[ Fact ]
96
113
public async Task with_timeout_any_stream_revision_tombstoning_fails_when_operation_expired ( ) {
97
- var stream = Fixture . GetStreamName ( ) ;
98
- var rpcException = await Assert . ThrowsAsync < RpcException > ( ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . Any , TimeSpan . Zero ) ) ;
114
+ var stream = Fixture . GetStreamName ( ) ;
115
+ var rpcException = await Assert . ThrowsAsync < RpcException > (
116
+ ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . Any , TimeSpan . Zero )
117
+ ) ;
99
118
100
119
Assert . Equal ( StatusCode . DeadlineExceeded , rpcException . StatusCode ) ;
101
120
}
@@ -104,7 +123,9 @@ public async Task with_timeout_any_stream_revision_tombstoning_fails_when_operat
104
123
public async Task with_timeout_stream_revision_tombstoning_fails_when_operation_expired ( ) {
105
124
var stream = Fixture . GetStreamName ( ) ;
106
125
107
- var rpcException = await Assert . ThrowsAsync < RpcException > ( ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . StreamRevision ( 0 ) , TimeSpan . Zero ) ) ;
126
+ var rpcException = await Assert . ThrowsAsync < RpcException > (
127
+ ( ) => Fixture . Streams . TombstoneAsync ( stream , StreamState . StreamRevision ( 0 ) , TimeSpan . Zero )
128
+ ) ;
108
129
109
130
Assert . Equal ( StatusCode . DeadlineExceeded , rpcException . StatusCode ) ;
110
131
}
0 commit comments