Files
sqltoolsservice/test/Microsoft.SqlTools.ServiceLayer.Test/Credentials/Linux/LinuxInteropTests.cs
Karl Burtram da84ae9f3b Code coverage improvements (#121)
These are test-only changes to improve code coverage so I'll merge directly.  Please review the commit and I'll pickup those changes in the next iteration.

* Add integration test batch file

* Exclude Linux and MacOS from Windows code coverage builds

* Enable code coverage for test driver e2e tests

* Use the windows only build for code coverage runs
2016-10-27 18:18:31 -07:00

40 lines
1020 B
C#

//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.ServiceLayer.Credentials;
using Microsoft.SqlTools.ServiceLayer.Credentials.Linux;
using Microsoft.SqlTools.ServiceLayer.Test.Utility;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.Test.Credentials
{
public class LinuxInteropTests
{
[Fact]
public void GetEUidReturnsInt()
{
#if !WINDOWS_ONLY_BUILD
TestUtils.RunIfLinux(() =>
{
Assert.NotNull(Interop.Sys.GetEUid());
});
#endif
}
[Fact]
public void GetHomeDirectoryFromPwFindsHomeDir()
{
#if !WINDOWS_ONLY_BUILD
TestUtils.RunIfLinux(() =>
{
string userDir = LinuxCredentialStore.GetHomeDirectoryFromPw();
Assert.StartsWith("/", userDir);
});
#endif
}
}
}