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:
Karl Burtram
2016-10-29 15:34:51 -07:00
committed by GitHub
parent 6cdaa6e808
commit ab1316b1fb
7 changed files with 265 additions and 56 deletions

View File

@@ -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>