File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/KerberosTests Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -47,21 +47,33 @@ public void CustomSspiContextGeneratorTest(string connectionStr)
4747
4848 Assert . Fail ( "Expected to use custom SSPI context provider" ) ;
4949 }
50- catch ( SspiTestException )
50+ catch ( SspiTestException sspi )
5151 {
52+ var builder = new SqlConnectionStringBuilder ( connectionStr ) ;
53+
54+ Assert . Equal ( sspi . AuthParams . ServerName , builder . DataSource ) ;
55+ Assert . Equal ( sspi . AuthParams . DatabaseName , builder . InitialCatalog ) ;
56+ Assert . Equal ( sspi . AuthParams . UserId , builder . UserID ) ;
57+ Assert . Equal ( sspi . AuthParams . Password , builder . Password ) ;
5258 }
5359 }
5460
5561 private sealed class TestSspiContextProvider : SspiContextProvider
5662 {
5763 protected override bool GenerateContext ( ReadOnlySpan < byte > incomingBlob , IBufferWriter < byte > outgoingBlobWriter , SspiAuthenticationParameters authParams )
5864 {
59- throw new SspiTestException ( ) ;
65+ throw new SspiTestException ( authParams ) ;
6066 }
6167 }
6268
6369 private sealed class SspiTestException : Exception
6470 {
71+ public SspiTestException ( SspiAuthenticationParameters authParams )
72+ {
73+ AuthParams = authParams ;
74+ }
75+
76+ public SspiAuthenticationParameters AuthParams { get ; }
6577 }
6678 }
6779
You can’t perform that action at this time.
0 commit comments