File tree Expand file tree Collapse file tree 5 files changed +20
-16
lines changed
Sentry.DiagnosticSource.Tests/Integration/SQLite
Sentry.EntityFramework.Tests Expand file tree Collapse file tree 5 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 4848
4949 <PackageReference Include =" NSubstitute" Version =" 5.1.0" />
5050 <PackageReference Include =" FluentAssertions" Version =" 6.12.0" />
51- <PackageReference Include =" xunit" Version =" 2.6.5 " />
51+ <PackageReference Include =" xunit" Version =" 2.9.2 " />
5252 <PackageReference Include =" Xunit.SkippableFact" Version =" 1.4.13" />
5353 <PackageReference Include =" GitHubActionsTestLogger" Version =" 2.3.3" />
5454 <PackageReference Include =" TestableIO.System.IO.Abstractions.TestingHelpers" Version =" 20.0.4" />
Original file line number Diff line number Diff line change @@ -806,7 +806,7 @@ public void PopulateScope_DoesNotDuplicateEventProcessorsWhenPopulateMultipleTim
806806 sut . PopulateScope ( _fixture . HttpContext , scope ) ;
807807 sut . PopulateScope ( _fixture . HttpContext , scope ) ;
808808
809- Assert . Single ( scope . GetAllEventProcessors ( ) . Where ( c => c == customProcessor ) ) ;
809+ Assert . Single ( scope . GetAllEventProcessors ( ) , c => c == customProcessor ) ;
810810 }
811811
812812 [ Fact ]
@@ -841,7 +841,7 @@ public void PopulateScope_DoesNotDuplicateExceptionEventProcessorsWhenPopulateMu
841841 sut . PopulateScope ( _fixture . HttpContext , scope ) ;
842842 sut . PopulateScope ( _fixture . HttpContext , scope ) ;
843843
844- Assert . Single ( scope . GetAllExceptionProcessors ( ) . Where ( c => c == customEventExceptionProcessor ) ) ;
844+ Assert . Single ( scope . GetAllExceptionProcessors ( ) , c => c == customEventExceptionProcessor ) ;
845845 }
846846
847847 [ Fact ]
@@ -876,6 +876,6 @@ public void PopulateScope_DoesNotDuplicateTransactionProcessorsWhenPopulateMulti
876876 sut . PopulateScope ( _fixture . HttpContext , scope ) ;
877877 sut . PopulateScope ( _fixture . HttpContext , scope ) ;
878878
879- Assert . Single ( scope . GetAllTransactionProcessors ( ) . Where ( c => c == customTransactionProcessor ) ) ;
879+ Assert . Single ( scope . GetAllTransactionProcessors ( ) , c => c == customTransactionProcessor ) ;
880880 }
881881}
Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ public void EfCoreIntegration_RunSynchronousQueryWithIssue_TransactionWithSpans(
9090 Assert . Single ( spans ) ; //1 command
9191#else
9292 Assert . Equal ( 2 , spans . Count ) ; //1 query compiler, 1 command
93- Assert . Single ( spans . Where ( s => s . Status == SpanStatus . Ok && s . Operation == "db.query.compile" ) ) ;
93+ Assert . Single ( spans , s => s is { Status : SpanStatus . Ok , Operation : "db.query.compile" } ) ;
9494#endif
95- Assert . Single ( spans . Where ( s => s . Status == SpanStatus . InternalError && s . Operation == "db.query" ) ) ;
95+ Assert . Single ( spans , s => s is { Status : SpanStatus . InternalError , Operation : "db.query" } ) ;
9696 Assert . All ( spans , span => Assert . True ( span . IsFinished ) ) ;
9797 }
9898
Original file line number Diff line number Diff line change @@ -210,12 +210,12 @@ public void FirstOrDefault_FromDatabase_CapturesQuery()
210210 // This operation will result in one reading operation and two non scalar operations.
211211 _fixture . Hub . Received ( 3 ) . GetSpan ( ) ;
212212 // In-memory database doesn't have a CommandText so Description is expected to be null
213- Assert . NotEmpty ( _fixture . Spans . Where (
214- span => DbNonQueryKey == span . Operation && span . Description is "CREATE SCHEMA (CodeFirstDatabase(dbo.__MigrationHistory(ContextKey(Effort.string)MigrationId(Effort.string)Model(Effort.binary)ProductVersion(Effort.string))))" ) ) ;
215- Assert . NotEmpty ( _fixture . Spans . Where (
216- span => DbNonQueryKey == span . Operation && span . Description is null ) ) ;
217- Assert . NotEmpty ( _fixture . Spans . Where (
218- span => DbReaderKey == span . Operation && span . Description is null ) ) ;
213+ Assert . Contains ( _fixture . Spans ,
214+ span => DbNonQueryKey == span . Operation &&
215+ span . Description is
216+ "CREATE SCHEMA (CodeFirstDatabase(dbo.__MigrationHistory(ContextKey(Effort.string)MigrationId(Effort.string)Model(Effort.binary)ProductVersion(Effort.string))))" ) ;
217+ Assert . Contains ( _fixture . Spans , span => DbNonQueryKey == span . Operation && span . Description is null ) ;
218+ Assert . Contains ( _fixture . Spans , span => DbReaderKey == span . Operation && span . Description is null ) ;
219219
220220 Assert . All ( _fixture . Spans , span => span . Received ( 1 ) . Finish ( Arg . Is < SpanStatus > ( status => SpanStatus . Ok == status ) ) ) ;
221221 integration . Unregister ( ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ public void Process_ExceptionWithout_Handled()
5151
5252 sut . Process ( exp , evt ) ;
5353
54- Assert . Single ( evt . SentryExceptions ! . Where ( p => p . Mechanism ? . Handled == null ) ) ;
54+ Assert . NotNull ( evt . SentryExceptions ) ;
55+ Assert . Single ( evt . SentryExceptions , p => p . Mechanism ? . Handled == null ) ;
5556 }
5657
5758 [ Fact ]
@@ -65,7 +66,8 @@ public void Process_ExceptionWith_HandledFalse()
6566
6667 sut . Process ( exp , evt ) ;
6768
68- Assert . Single ( evt . SentryExceptions ! . Where ( p => p . Mechanism ? . Handled == false ) ) ;
69+ Assert . NotNull ( evt . SentryExceptions ) ;
70+ Assert . Single ( evt . SentryExceptions , p => p . Mechanism ? . Handled == false ) ;
6971 }
7072
7173 [ Fact ]
@@ -79,7 +81,8 @@ public void Process_ExceptionWith_HandledTrue()
7981
8082 sut . Process ( exp , evt ) ;
8183
82- Assert . Single ( evt . SentryExceptions ! . Where ( p => p . Mechanism ? . Handled == true ) ) ;
84+ Assert . NotNull ( evt . SentryExceptions ) ;
85+ Assert . Single ( evt . SentryExceptions , p => p . Mechanism ? . Handled == true ) ;
8386 }
8487
8588 [ Fact ]
@@ -91,7 +94,8 @@ public void Process_ExceptionWith_HandledTrue_WhenCaught()
9194
9295 sut . Process ( exp , evt ) ;
9396
94- Assert . Single ( evt . SentryExceptions ! . Where ( p => p . Mechanism ? . Handled == true ) ) ;
97+ Assert . NotNull ( evt . SentryExceptions ) ;
98+ Assert . Single ( evt . SentryExceptions , p => p . Mechanism ? . Handled == true ) ;
9599 }
96100
97101 [ Fact ]
You can’t perform that action at this time.
0 commit comments