File tree Expand file tree Collapse file tree 10 files changed +1098
-9
lines changed
Coderr.Server.SqlServer.Tests Expand file tree Collapse file tree 10 files changed +1098
-9
lines changed Original file line number Diff line number Diff line change 55using codeRR . Server . ReportAnalyzer . Domain . Reports ;
66using codeRR . Server . SqlServer . Analysis ;
77using Xunit ;
8+ using Xunit . Abstractions ;
89
910namespace codeRR . Server . SqlServer . Tests . Analysis
1011{
1112 public class IncidentBeingAnalyzedMapperTests : IntegrationTest
1213 {
13- public IncidentBeingAnalyzedMapperTests ( )
14+ public IncidentBeingAnalyzedMapperTests ( ITestOutputHelper helper ) : base ( helper )
1415 {
1516 ResetDatabase ( ) ;
1617 }
Original file line number Diff line number Diff line change 1111using Griffin . Data ;
1212using NSubstitute ;
1313using Xunit ;
14+ using Xunit . Abstractions ;
1415
1516namespace codeRR . Server . SqlServer . Tests . Core . ApiKeys . Commands
1617{
@@ -19,7 +20,7 @@ public class CreateApiKeyHandlerTests : IntegrationTest
1920 {
2021 private int _applicationId ;
2122
22- public CreateApiKeyHandlerTests ( )
23+ public CreateApiKeyHandlerTests ( ITestOutputHelper helper ) : base ( helper )
2324 {
2425 GetApplicationId ( ) ;
2526 }
Original file line number Diff line number Diff line change 1111using Griffin . Data ;
1212using NSubstitute ;
1313using Xunit ;
14+ using Xunit . Abstractions ;
1415
1516namespace codeRR . Server . SqlServer . Tests . Core . ApiKeys . Commands
1617{
@@ -20,7 +21,7 @@ public class DeleteApiKeyHandlerTests : IntegrationTest
2021 private int _applicationId ;
2122 private readonly ApiKey _existingEntity ;
2223
23- public DeleteApiKeyHandlerTests ( )
24+ public DeleteApiKeyHandlerTests ( ITestOutputHelper helper ) : base ( helper )
2425 {
2526 GetApplicationId ( ) ;
2627
Original file line number Diff line number Diff line change 1111using NSubstitute ;
1212using NSubstitute . Core ;
1313using Xunit ;
14+ using Xunit . Abstractions ;
1415
1516namespace codeRR . Server . SqlServer . Tests . Core . ApiKeys . Queries
1617{
@@ -20,7 +21,7 @@ public class GetApiKeyHandlerTests : IntegrationTest
2021 private Application _application ;
2122 private readonly ApiKey _existingEntity ;
2223
23- public GetApiKeyHandlerTests ( )
24+ public GetApiKeyHandlerTests ( ITestOutputHelper helper ) : base ( helper )
2425 {
2526 GetApplication ( ) ;
2627
Original file line number Diff line number Diff line change 88using Griffin . Data . Mapper ;
99using NSubstitute ;
1010using Xunit ;
11+ using Xunit . Abstractions ;
1112
1213namespace codeRR . Server . SqlServer . Tests . Core . ApiKeys . Queries
1314{
@@ -16,7 +17,7 @@ public class ListApiKeysHandlerTests : IntegrationTest
1617 {
1718 private readonly ApiKey _existingEntity ;
1819
19- public ListApiKeysHandlerTests ( )
20+ public ListApiKeysHandlerTests ( ITestOutputHelper helper ) : base ( helper )
2021 {
2122 _existingEntity = new ApiKey
2223 {
Original file line number Diff line number Diff line change 33using codeRR . Server . SqlServer . Tests . Helpers ;
44using Griffin . Data ;
55using Griffin . Data . Mapper ;
6+ using Xunit . Abstractions ;
67
78namespace codeRR . Server . SqlServer . Tests
89{
10+ [ Log ]
911 public class IntegrationTest : IDisposable
1012 {
1113 private static DatabaseManager _databaseManager ;
@@ -33,9 +35,9 @@ static IntegrationTest()
3335 mapper . Scan ( typeof ( AccountRepository ) . Assembly ) ;
3436 EntityMappingProvider . Provider = mapper ;
3537 }
36-
37- public IntegrationTest ( )
38+ public IntegrationTest ( ITestOutputHelper output )
3839 {
40+ LogAttribute . Logger = output ;
3941 _testDataManager = new TestDataManager ( _databaseManager . OpenConnection ) ;
4042 }
4143
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Diagnostics ;
4+ using System . Linq ;
5+ using System . Reflection ;
6+ using System . Text ;
7+ using System . Threading . Tasks ;
8+ using Xunit . Abstractions ;
9+ using Xunit . Sdk ;
10+
11+ namespace codeRR . Server . SqlServer . Tests
12+ {
13+ public class LogAttribute : BeforeAfterTestAttribute
14+ {
15+ public static ITestOutputHelper Logger { get ; set ; }
16+
17+ public override void Before ( MethodInfo methodUnderTest )
18+ {
19+ Logger ? . WriteLine ( "Running " + methodUnderTest . DeclaringType . Name + "." + methodUnderTest . Name ) ;
20+ Debug . WriteLine ( "Running " + methodUnderTest . DeclaringType . Name + "." + methodUnderTest . Name ) ;
21+ Console . WriteLine ( "Running " + methodUnderTest . DeclaringType . Name + "." + methodUnderTest . Name ) ;
22+ base . Before ( methodUnderTest ) ;
23+ }
24+
25+ public override void After ( MethodInfo methodUnderTest )
26+ {
27+ Logger ? . WriteLine ( "Completed " + methodUnderTest . DeclaringType . Name + "." + methodUnderTest . Name ) ;
28+ Debug . WriteLine ( "Completed " + methodUnderTest . DeclaringType . Name + "." + methodUnderTest . Name ) ;
29+ Console . WriteLine ( "Completed " + methodUnderTest . DeclaringType . Name + "." + methodUnderTest . Name ) ;
30+ base . After ( methodUnderTest ) ;
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change 33using codeRR . Server . App . Modules . Geolocation ;
44using codeRR . Server . SqlServer . Modules . Geolocation ;
55using Xunit ;
6+ using Xunit . Abstractions ;
67
78namespace codeRR . Server . SqlServer . Tests . Modules . Geolocation
89{
@@ -11,7 +12,7 @@ public class ErrorOriginRepositoryTests : IntegrationTest
1112 private int _reportId ;
1213 private int _incidentId ;
1314
14- public ErrorOriginRepositoryTests ( )
15+ public ErrorOriginRepositoryTests ( ITestOutputHelper helper ) : base ( helper )
1516 {
1617 ResetDatabase ( ) ;
1718 CreateReportAndIncident ( out _reportId , out _incidentId ) ;
Original file line number Diff line number Diff line change 22
33<configuration >
44 <connectionStrings >
5- <add name =" Db" connectionString =" Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog={databaseName};Integrated Security=True" providerName =" System.Data.SqlClient" />
5+ <add name =" Db" connectionString =" Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog={databaseName};Integrated Security=True;Connection Timeout=5 " providerName =" System.Data.SqlClient" />
66 </connectionStrings >
77 <runtime >
88 <assemblyBinding xmlns =" urn:schemas-microsoft-com:asm.v1" >
You can’t perform that action at this time.
0 commit comments