From d4f08a971d1822c64f266c3ddccbcdb1e66044df Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Thu, 3 Sep 2015 16:41:14 -0700 Subject: [PATCH] changed according to code review --- src/ps_test/test_CorePsPlatform.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index a8bf60eb9..f2fcef456 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -93,35 +93,26 @@ namespace PSTests } [Fact] - public static void TestIsHardLinkWithFileSystemInfo() + public static void TestExistantFileIsHardLink() { - // a file that should exist on every *nix distro - string path = @"/tmp/MyTest"; if (!File.Exists(path)) { File.Create(path); } - // Create a file to write to using StreamWriter. // convert string to stream. On Windows, this appears to be handled, but on *nix, we apparently need to convert to UTF8. byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(path); MemoryStream stream = new MemoryStream(byteArray); - using (StreamWriter sw = new StreamWriter(stream)) - { - sw.Write("Hello"); - } - // Convert `path` string to FileSystemInfo data type. And now, it should return true FileSystemInfo fd = new FileInfo(path); Assert.True(Platform.NonWindowsIsHardLink(fd)); } [Fact] - public static void TestIsHardLinkFailsWithDirectoryWithFileSystemInfo() + public static void TestDirectoryIsHardLink() { - // A folder that should exist on every *nix system string path = @"/tmp"; // Convert `path` string to FileSystemInfo data type. And now, it should return true @@ -130,7 +121,7 @@ namespace PSTests } [Fact] - public static void TestIsHardLinkFailsWithNonexistantFileWithFileSystemInfo() + public static void TestNonExistantIsHardLink() { // A file that should *never* exist on a test machine: string path = @"/tmp/ThisFileShouldNotExistOnTestMachines";