mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-16 17:23:38 -05:00
Next batch of code coverage tests. (#128)
Auto-merging test-only changes. Please review the commit and I'll make changes in next iteration. * Add more tests to boast code coverage * Add more reliable connection tests.
This commit is contained in:
@@ -809,6 +809,33 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Connection
|
||||
Assert.True(callbackInvoked);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test ConnectionSummaryComparer
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestConnectionSummaryComparer()
|
||||
{
|
||||
var summary1 = new ConnectionSummary()
|
||||
{
|
||||
ServerName = "localhost",
|
||||
DatabaseName = "master",
|
||||
UserName = "user"
|
||||
};
|
||||
|
||||
var summary2 = new ConnectionSummary()
|
||||
{
|
||||
ServerName = "localhost",
|
||||
DatabaseName = "master",
|
||||
UserName = "user"
|
||||
};
|
||||
|
||||
var comparer = new ConnectionSummaryComparer();
|
||||
Assert.True(comparer.Equals(summary1, summary2));
|
||||
|
||||
summary2.DatabaseName = "tempdb";
|
||||
Assert.False(comparer.Equals(summary1, summary2));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify when a connection is created that the URI -> Connection mapping is created in the connection service.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user