public void FilePathWrapper_GetFileName_AreEqual_ToLastStringAfterDevider_ExpectTrue() { //------------------------Arrange------------------------ var filePathWrapper = new FilePathWrapper(); //------------------------Act---------------------------- var fileName = filePathWrapper.GetFileName(@"O:\Test\testFileName.txt"); //------------------------Assert------------------------- Assert.AreEqual("testFileName.txt", fileName); }
public void FilePathWrapper_IsPathRooted_HasNoRoot_relativePath_ExpectFalse() { //------------------------Arrange------------------------ var relativePath = @"mydir\sudir\"; var filePathWrapper = new FilePathWrapper(); //------------------------Act---------------------------- var isPathRooted = filePathWrapper.IsPathRooted(relativePath); //------------------------Assert------------------------- Assert.IsFalse(isPathRooted); }
public void FilePathWrapper_IsPathRooted_HasRoot_UncPath_ExpectTrue() { //------------------------Arrange------------------------ var UncPath = @"\\myPc\mydir\myfile"; var filePathWrapper = new FilePathWrapper(); //------------------------Act---------------------------- var isPathRooted = filePathWrapper.IsPathRooted(UncPath); //------------------------Assert------------------------- Assert.IsTrue(isPathRooted); }
public void FilePathWrapper_IsPathRooted_HasRoot_LocalDir_ExpectTrue() { //------------------------Arrange------------------------ var path = @"O:\TestPath1\TestPath2\testFileName.txt"; var filePathWrapper = new FilePathWrapper(); //------------------------Act---------------------------- var isPathRooted = filePathWrapper.IsPathRooted(path); //------------------------Assert------------------------- Assert.IsTrue(isPathRooted); }
public void FilePathWrapper_Combine_AreEqual_ToArrayOfString_ExpectTrue() { //------------------------Arrange------------------------ var paths = new string[] { @"O:\TestPath1", "TestPath2", "testFileName.txt" }; var filePathWrapper = new FilePathWrapper(); //------------------------Act---------------------------- var combinedTestPaths = filePathWrapper.Combine(paths); //------------------------Assert------------------------- Assert.AreEqual(@"O:\TestPath1\TestPath2\testFileName.txt", combinedTestPaths); }