@@ -57,26 +57,6 @@ public async Task PreLoginEncryptionExcludedTest()
57
57
Assert . Contains ( "The instance of SQL Server you attempted to connect to does not support encryption." , ex . Message , StringComparison . OrdinalIgnoreCase ) ;
58
58
}
59
59
60
- [ ConditionalTheory ( typeof ( TestUtility ) , nameof ( TestUtility . IsNotArmProcess ) ) ]
61
- [ InlineData ( 40613 ) ]
62
- [ InlineData ( 42108 ) ]
63
- [ InlineData ( 42109 ) ]
64
- [ PlatformSpecific ( TestPlatforms . Windows ) ]
65
- public async Task TransientFaultTestAsync ( uint errorCode )
66
- {
67
- using TransientFaultTDSServer server = TransientFaultTDSServer . StartTestServer ( true , true , errorCode ) ;
68
- SqlConnectionStringBuilder builder = new ( )
69
- {
70
- DataSource = "localhost," + server . Port ,
71
- IntegratedSecurity = true ,
72
- Encrypt = SqlConnectionEncryptOption . Optional
73
- } ;
74
-
75
- using SqlConnection connection = new ( builder . ConnectionString ) ;
76
- await connection . OpenAsync ( ) ;
77
- Assert . Equal ( ConnectionState . Open , connection . State ) ;
78
- }
79
-
80
60
[ ConditionalTheory ( typeof ( TestUtility ) , nameof ( TestUtility . IsNotArmProcess ) ) ]
81
61
[ InlineData ( 40613 ) ]
82
62
[ InlineData ( 42108 ) ]
@@ -100,54 +80,14 @@ public void TransientFaultTest(uint errorCode)
100
80
}
101
81
catch ( Exception e )
102
82
{
83
+ if ( null != connection )
84
+ {
85
+ Assert . Equal ( ConnectionState . Closed , connection . State ) ;
86
+ }
103
87
Assert . Fail ( e . Message ) ;
104
88
}
105
89
}
106
90
107
- [ ConditionalTheory ( typeof ( TestUtility ) , nameof ( TestUtility . IsNotArmProcess ) ) ]
108
- [ InlineData ( 40613 ) ]
109
- [ InlineData ( 42108 ) ]
110
- [ InlineData ( 42109 ) ]
111
- [ PlatformSpecific ( TestPlatforms . Windows ) ]
112
- public void TransientFaultDisabledTestAsync ( uint errorCode )
113
- {
114
- using TransientFaultTDSServer server = TransientFaultTDSServer . StartTestServer ( true , true , errorCode ) ;
115
- SqlConnectionStringBuilder builder = new ( )
116
- {
117
- DataSource = "localhost," + server . Port ,
118
- IntegratedSecurity = true ,
119
- ConnectRetryCount = 0 ,
120
- Encrypt = SqlConnectionEncryptOption . Optional
121
- } ;
122
-
123
- using SqlConnection connection = new ( builder . ConnectionString ) ;
124
- Task < SqlException > e = Assert . ThrowsAsync < SqlException > ( async ( ) => await connection . OpenAsync ( ) ) ;
125
- Assert . Equal ( 20 , e . Result . Class ) ;
126
- Assert . Equal ( ConnectionState . Closed , connection . State ) ;
127
- }
128
-
129
- [ ConditionalTheory ( typeof ( TestUtility ) , nameof ( TestUtility . IsNotArmProcess ) ) ]
130
- [ InlineData ( 40613 ) ]
131
- [ InlineData ( 42108 ) ]
132
- [ InlineData ( 42109 ) ]
133
- [ PlatformSpecific ( TestPlatforms . Windows ) ]
134
- public void TransientFaultDisabledTest ( uint errorCode )
135
- {
136
- using TransientFaultTDSServer server = TransientFaultTDSServer . StartTestServer ( true , true , errorCode ) ;
137
- SqlConnectionStringBuilder builder = new ( )
138
- {
139
- DataSource = "localhost," + server . Port ,
140
- IntegratedSecurity = true ,
141
- ConnectRetryCount = 0 ,
142
- Encrypt = SqlConnectionEncryptOption . Optional
143
- } ;
144
-
145
- using SqlConnection connection = new ( builder . ConnectionString ) ;
146
- SqlException e = Assert . Throws < SqlException > ( ( ) => connection . Open ( ) ) ;
147
- Assert . Equal ( 20 , e . Class ) ;
148
- Assert . Equal ( ConnectionState . Closed , connection . State ) ;
149
- }
150
-
151
91
[ Fact ]
152
92
public void SqlConnectionDbProviderFactoryTest ( )
153
93
{
0 commit comments