Files
sqltoolsservice/test/Microsoft.SqlTools.ServiceLayer.UnitTests/DisasterRecovery/DisasterRecoveryFileValidatorUnitTests.cs
Kate Shin 14ec5be961 Create remote file browser service (#448)
* code refactoring

* Add filebrowser service and tests

* change dataset reference

* Address pr comments

* add more tests

* address pr comments

* address pr comments and added more tests

* minor change

* minor fix

* Fix test break and add dataset result check
2017-09-08 13:57:56 -07:00

40 lines
1.3 KiB
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.DisasterRecovery;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.DisasterRecovery
{
/// <summary>
/// Unit tests for disaster recovery file validator
/// </summary>
public class DisasterRecoveryFileValidatorUnitTests
{
[Fact]
public void ValidatorShouldReturnFalseForNullArgument()
{
string message;
bool result = DisasterRecoveryFileValidator.ValidatePaths(null, out message);
Assert.False(result);
}
[Fact]
public void GetMachineNameForLocalServer()
{
string machineName = DisasterRecoveryFileValidator.GetMachineName(DisasterRecoveryFileValidator.LocalSqlServer);
Assert.True(System.Environment.MachineName == machineName);
}
[Fact]
public void GetMachineNameForNamedServer()
{
string testMachineName = "testmachine";
string machineName = DisasterRecoveryFileValidator.GetMachineName(string.Format("{0}\\testserver", testMachineName));
Assert.True(testMachineName == machineName);
}
}
}