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)
47
47
48
48
Assert . Fail ( "Expected to use custom SSPI context provider" ) ;
49
49
}
50
- catch ( SspiTestException )
50
+ catch ( SspiTestException sspi )
51
51
{
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 ) ;
52
58
}
53
59
}
54
60
55
61
private sealed class TestSspiContextProvider : SspiContextProvider
56
62
{
57
63
protected override bool GenerateContext ( ReadOnlySpan < byte > incomingBlob , IBufferWriter < byte > outgoingBlobWriter , SspiAuthenticationParameters authParams )
58
64
{
59
- throw new SspiTestException ( ) ;
65
+ throw new SspiTestException ( authParams ) ;
60
66
}
61
67
}
62
68
63
69
private sealed class SspiTestException : Exception
64
70
{
71
+ public SspiTestException ( SspiAuthenticationParameters authParams )
72
+ {
73
+ AuthParams = authParams ;
74
+ }
75
+
76
+ public SspiAuthenticationParameters AuthParams { get ; }
65
77
}
66
78
}
67
79
You can’t perform that action at this time.
0 commit comments