mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Add FileSystemProvider xUnit test for issue 120
This commit is contained in:
1 parent
80a9c10854
commit
920bc1f3f8
1 file changed
+64
@@ -1,6 +1,9 @@
|
|||||||
using Xunit;
|
using Xunit;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.IO;
|
||||||
using System.Management.Automation;
|
using System.Management.Automation;
|
||||||
|
using System.Management.Automation.Provider;
|
||||||
using Microsoft.PowerShell.Commands;
|
using Microsoft.PowerShell.Commands;
|
||||||
|
|
||||||
namespace PSTests
|
namespace PSTests
|
||||||
@@ -12,6 +15,67 @@ namespace PSTests
|
|||||||
public static void TestCreateJunctionFails()
|
public static void TestCreateJunctionFails()
|
||||||
{
|
{
|
||||||
Assert.False(InternalSymbolicLinkLinkCodeMethods.CreateJunction("",""));
|
Assert.False(InternalSymbolicLinkLinkCodeMethods.CreateJunction("",""));
|
||||||
|
}
|
||||||
|
|
||||||
|
[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()
|
||||||
|
{
|
||||||
|
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||||
|
fileSystemProvider.GetProperty(@"/", new Collection<string>(){"Attributes"});
|
||||||
|
}
|
||||||
|
|
||||||
|
[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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user