2015-08-06 16:24:18 +02:00
|
|
|
using Xunit;
|
|
|
|
using System;
|
2016-03-17 09:34:48 +01:00
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.IO;
|
2015-08-06 16:24:18 +02:00
|
|
|
using System.Management.Automation;
|
2016-03-17 09:34:48 +01:00
|
|
|
using System.Management.Automation.Provider;
|
2015-08-06 16:24:18 +02:00
|
|
|
using Microsoft.PowerShell.Commands;
|
|
|
|
|
|
|
|
namespace PSTests
|
|
|
|
{
|
2016-03-18 02:15:39 +01:00
|
|
|
[Collection("AssemblyLoadContext")]
|
2015-08-06 16:24:18 +02:00
|
|
|
public static class FileSystemProviderTests
|
|
|
|
{
|
|
|
|
[Fact]
|
|
|
|
public static void TestCreateJunctionFails()
|
|
|
|
{
|
|
|
|
Assert.False(InternalSymbolicLinkLinkCodeMethods.CreateJunction("",""));
|
2016-03-17 09:34:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestGetHelpMaml()
|
|
|
|
{
|
|
|
|
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,String.Empty),String.Empty);
|
|
|
|
Assert.Equal(fileSystemProvider.GetHelpMaml("helpItemName",String.Empty),String.Empty);
|
|
|
|
Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,"path"),String.Empty);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestMode()
|
|
|
|
{
|
|
|
|
Assert.Equal(FileSystemProvider.Mode(null),String.Empty);
|
|
|
|
FileSystemInfo fileSystemObject = new DirectoryInfo(@"/");
|
|
|
|
Assert.NotEqual(FileSystemProvider.Mode(PSObject.AsPSObject(fileSystemObject)),String.Empty);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestGetProperty()
|
|
|
|
{
|
2016-03-18 05:19:40 +01:00
|
|
|
//FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
//fileSystemProvider.GetProperty(@"/", new Collection<string>(){"Attributes"});
|
2016-03-17 09:34:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestSetProperty()
|
|
|
|
{
|
|
|
|
//FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
//fileSystemProvider.SetProperty(@"/root", PSObject.AsPSObject(propertyToSet));
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestClearProperty()
|
|
|
|
{
|
|
|
|
// FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
// fileSystemProvider.ClearProperty(@"/test", new Collection<string>(){"Attributes"});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestGetContentReader()
|
|
|
|
{
|
|
|
|
// FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
// IContentReader contentReader = fileSystemProvider.GetContentReader(@"/test");
|
|
|
|
// Assert.NotNull(contentReader);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestGetContentWriter()
|
|
|
|
{
|
|
|
|
// FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
// IContentWriter contentWriter = fileSystemProvider.GetContentWriter(@"/test");
|
|
|
|
// Assert.NotNull(contentWriter);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public static void TestClearContent()
|
|
|
|
{
|
|
|
|
//FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
|
|
|
//fileSystemProvider.ClearContent(@"/test");
|
2015-08-06 16:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|