public void GoodInput_NoTrailingSlash() { string test = @"C:\Windows\SysWow"; string test2 = @"C:\Windows\SysWow"; Assert.AreEqual(PathShim.TrimEndingDirectorySeparator(test), test2); }
public void UpOneLevel_TwoLevelWithTrailingBackslash() { var stringA = @"C:\A\"; var stringB = @"C:\"; Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB); }
public void UpOneLevel_NoTrailingBackslash() { var stringA = @"C:\A\Test\String"; var stringB = @"C:\A\Test\"; Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB); }
public void BadInput_Empty() { Inventor.Application app = ApplicationShim.Instance(); var test = string.Empty; Assert.IsFalse(PathShim.IsContentCenterPath(test, ref app)); }
public void UpOneLevel_ForwardSlashes_ReturnNothing() { var stringA = @"C:/Users/"; var stringB = @"C:/"; Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB); }
public void BadInput_Wrong() { Inventor.Application app = ApplicationShim.Instance(); string test = @"C:\Windows\"; Assert.IsFalse(PathShim.IsContentCenterPath(test, ref app)); }
public void GoodInput() { Inventor.Application app = ApplicationShim.Instance(); var designProject = app.DesignProjectManager.ActiveDesignProject; var libraryPaths = designProject.LibraryPaths; var i = libraryPaths.Count + 1; libraryPaths.Add("temporary path", @"C:\"); string test = libraryPaths[1].Path; test = PathShim.TrimEndingDirectorySeparator(test); try { Assert.IsTrue(test.IsLibraryPath(app)); } finally { libraryPaths[i].Delete(); Marshal.ReleaseComObject(app); app = null; } }
public void UpOneLevel_TopLevel_ReturnsSelf() { var stringA = @"C:\"; var stringB = @"C:"; Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB); }
public void UpOneLevel_NoBackslashes() { var stringA = @"C:"; string stringB = ""; Assert.AreNotEqual(PathShim.UpOneLevel(stringA), stringB); }
public void BadInput_Null() { Inventor.Application app = ApplicationShim.Instance(); string test = null; Assert.IsFalse(PathShim.IsLibraryPath(test, ref app)); }
public void GoodInput() { Inventor.Application app = ApplicationShim.Instance(); string test = app.DesignProjectManager.ActiveDesignProject.ContentCenterPath; Assert.IsTrue(PathShim.IsContentCenterPath(test, ref app)); }
public void BadInput_Empty() { Inventor.Application app = ApplicationShim.Instance(); var test = ""; Assert.IsFalse(PathShim.IsLibraryPath(test, ref app)); }
public void BadInput_WrongPath() { Inventor.Application app = ApplicationShim.Instance(); var test = @"C:\Zarthastoriatarigula\the\fiverth"; Assert.IsFalse(PathShim.IsLibraryPath(test, ref app)); }
public void GoodInput_NoTrailingSlash() { Inventor.Application app = ApplicationShim.Instance(); string test = app.DesignProjectManager.ActiveDesignProject.ContentCenterPath; test = PathShim.TrimEndingDirectorySeparator(test); Assert.IsTrue(PathShim.IsContentCenterPath(test, ref app)); }
public void BadInput_Null() { Inventor.Application app = ApplicationShim.Instance(); app.Documents.CloseAll(); DesignProject dp = app.DesignProjectManager.ActiveDesignProject; dp.Activate(); string test = null; Assert.IsFalse(PathShim.IsContentCenterPath(test, ref app)); }
public void GoodInput_NoTrailingSlash() { Inventor.Application app = ApplicationShim.Instance(); string test = app.DesignProjectManager.ActiveDesignProject.ContentCenterPath; test = PathShim.TrimEndingDirectorySeparator(test); try { Assert.IsTrue(test.IsContentCenterPath(app)); } finally { Marshal.ReleaseComObject(app); app = null; } }
public void UpOneLevel_MultipleInputs(string stringA, string stringB) { Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB); }
public void GoodInput_TrailingSlash(string testA, string testB) { Assert.AreEqual(PathShim.TrimEndingDirectorySeparator(testA), testB); }