@@ -54,9 +54,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
5454
5555 responseDocument . Data . SingleValue . ShouldNotBeNull ( ) ;
5656 responseDocument . Data . SingleValue . Id . Should ( ) . Be ( broadcast . StringId ) ;
57-
58- responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" )
59- . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeCloseTo ( broadcast . ArchivedAt ! . Value ) ) ;
57+ responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . Be ( broadcast . ArchivedAt ) ) ;
6058 }
6159
6260 [ Fact ]
@@ -82,7 +80,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
8280
8381 responseDocument . Data . SingleValue . ShouldNotBeNull ( ) ;
8482 responseDocument . Data . SingleValue . Id . Should ( ) . Be ( broadcast . StringId ) ;
85- responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeNull ( ) ) ;
83+ responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
8684 }
8785
8886 [ Fact ]
@@ -109,7 +107,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
109107
110108 responseDocument . Data . ManyValue . ShouldHaveCount ( 1 ) ;
111109 responseDocument . Data . ManyValue [ 0 ] . Id . Should ( ) . Be ( broadcasts [ 1 ] . StringId ) ;
112- responseDocument . Data . ManyValue [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeNull ( ) ) ;
110+ responseDocument . Data . ManyValue [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
113111 }
114112
115113 [ Fact ]
@@ -136,9 +134,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
136134
137135 responseDocument . Data . ManyValue . ShouldHaveCount ( 2 ) ;
138136 responseDocument . Data . ManyValue [ 0 ] . Id . Should ( ) . Be ( broadcasts [ 0 ] . StringId ) ;
139-
140- responseDocument . Data . ManyValue [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" )
141- . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeCloseTo ( broadcasts [ 0 ] . ArchivedAt ! . Value ) ) ;
137+ responseDocument . Data . ManyValue [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . Be ( broadcasts [ 0 ] . ArchivedAt ) ) ;
142138
143139 responseDocument . Data . ManyValue [ 1 ] . Id . Should ( ) . Be ( broadcasts [ 1 ] . StringId ) ;
144140 responseDocument . Data . ManyValue [ 1 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
@@ -204,7 +200,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
204200
205201 responseDocument . Included . ShouldHaveCount ( 2 ) ;
206202 responseDocument . Included [ 0 ] . Id . Should ( ) . Be ( station . Broadcasts . ElementAt ( 0 ) . StringId ) ;
207- responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeCloseTo ( archivedAt0 ) ) ;
203+ responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . Be ( archivedAt0 ) ) ;
208204 responseDocument . Included [ 1 ] . Id . Should ( ) . Be ( station . Broadcasts . ElementAt ( 1 ) . StringId ) ;
209205 responseDocument . Included [ 1 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
210206 }
@@ -232,9 +228,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
232228
233229 responseDocument . Data . SingleValue . ShouldNotBeNull ( ) ;
234230 responseDocument . Data . SingleValue . Id . Should ( ) . Be ( comment . AppliesTo . StringId ) ;
235-
236- responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" )
237- . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeCloseTo ( comment . AppliesTo . ArchivedAt ! . Value ) ) ;
231+ responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . Be ( comment . AppliesTo . ArchivedAt ) ) ;
238232 }
239233
240234 [ Fact ]
@@ -286,11 +280,11 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
286280 // Assert
287281 httpResponse . Should ( ) . HaveStatusCode ( HttpStatusCode . OK ) ;
288282
283+ DateTimeOffset archivedAt0 = station . Broadcasts . ElementAt ( 0 ) . ArchivedAt ! . Value ;
284+
289285 responseDocument . Data . ManyValue . ShouldHaveCount ( 2 ) ;
290286 responseDocument . Data . ManyValue [ 0 ] . Id . Should ( ) . Be ( station . Broadcasts . ElementAt ( 0 ) . StringId ) ;
291-
292- responseDocument . Data . ManyValue [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value =>
293- value . As < DateTimeOffset ? > ( ) . Should ( ) . BeCloseTo ( station . Broadcasts . ElementAt ( 0 ) . ArchivedAt ! . Value ) ) ;
287+ responseDocument . Data . ManyValue [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . Be ( archivedAt0 ) ) ;
294288
295289 responseDocument . Data . ManyValue [ 1 ] . Id . Should ( ) . Be ( station . Broadcasts . ElementAt ( 1 ) . StringId ) ;
296290 responseDocument . Data . ManyValue [ 1 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
@@ -357,7 +351,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
357351
358352 responseDocument . Included . ShouldHaveCount ( 2 ) ;
359353 responseDocument . Included [ 0 ] . Id . Should ( ) . Be ( network . Stations . ElementAt ( 0 ) . Broadcasts . ElementAt ( 0 ) . StringId ) ;
360- responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . As < DateTimeOffset ? > ( ) . Should ( ) . BeCloseTo ( archivedAt0 ) ) ;
354+ responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . Be ( archivedAt0 ) ) ;
361355 responseDocument . Included [ 1 ] . Id . Should ( ) . Be ( network . Stations . ElementAt ( 0 ) . Broadcasts . ElementAt ( 1 ) . StringId ) ;
362356 responseDocument . Included [ 1 ] . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
363357 }
@@ -444,10 +438,7 @@ public async Task Can_create_unarchived_resource()
444438
445439 responseDocument . Data . SingleValue . ShouldNotBeNull ( ) ;
446440 responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "title" ) . With ( value => value . Should ( ) . Be ( newBroadcast . Title ) ) ;
447-
448- responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "airedAt" )
449- . With ( value => value . As < DateTimeOffset > ( ) . Should ( ) . BeCloseTo ( newBroadcast . AiredAt ) ) ;
450-
441+ responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "airedAt" ) . With ( value => value . Should ( ) . Be ( newBroadcast . AiredAt ) ) ;
451442 responseDocument . Data . SingleValue . Attributes . ShouldContainKey ( "archivedAt" ) . With ( value => value . Should ( ) . BeNull ( ) ) ;
452443 }
453444
@@ -529,7 +520,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
529520 {
530521 TelevisionBroadcast broadcastInDatabase = await dbContext . Broadcasts . FirstWithIdAsync ( existingBroadcast . Id ) ;
531522
532- broadcastInDatabase . ArchivedAt . Should ( ) . BeCloseTo ( newArchivedAt ) ;
523+ broadcastInDatabase . ArchivedAt . Should ( ) . Be ( newArchivedAt ) ;
533524 } ) ;
534525 }
535526
0 commit comments