Exemplo n.º 1
0
        public void GoodInput_NoTrailingSlash()
        {
            string test  = @"C:\Windows\SysWow";
            string test2 = @"C:\Windows\SysWow";

            Assert.AreEqual(PathShim.TrimEndingDirectorySeparator(test), test2);
        }
Exemplo n.º 2
0
        public void UpOneLevel_TwoLevelWithTrailingBackslash()
        {
            var stringA = @"C:\A\";
            var stringB = @"C:\";

            Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB);
        }
Exemplo n.º 3
0
        public void UpOneLevel_NoTrailingBackslash()
        {
            var stringA = @"C:\A\Test\String";
            var stringB = @"C:\A\Test\";

            Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB);
        }
Exemplo n.º 4
0
        public void BadInput_Empty()
        {
            Inventor.Application app = ApplicationShim.Instance();
            var test = string.Empty;

            Assert.IsFalse(PathShim.IsContentCenterPath(test, ref app));
        }
Exemplo n.º 5
0
        public void UpOneLevel_ForwardSlashes_ReturnNothing()
        {
            var stringA = @"C:/Users/";
            var stringB = @"C:/";

            Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB);
        }
Exemplo n.º 6
0
        public void BadInput_Wrong()
        {
            Inventor.Application app = ApplicationShim.Instance();
            string test = @"C:\Windows\";

            Assert.IsFalse(PathShim.IsContentCenterPath(test, ref app));
        }
Exemplo n.º 7
0
        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;
            }
        }
Exemplo n.º 8
0
        public void UpOneLevel_TopLevel_ReturnsSelf()
        {
            var stringA = @"C:\";
            var stringB = @"C:";

            Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB);
        }
Exemplo n.º 9
0
        public void UpOneLevel_NoBackslashes()
        {
            var    stringA = @"C:";
            string stringB = "";

            Assert.AreNotEqual(PathShim.UpOneLevel(stringA), stringB);
        }
Exemplo n.º 10
0
        public void BadInput_Null()
        {
            Inventor.Application app = ApplicationShim.Instance();

            string test = null;

            Assert.IsFalse(PathShim.IsLibraryPath(test, ref app));
        }
Exemplo n.º 11
0
        public void GoodInput()
        {
            Inventor.Application app = ApplicationShim.Instance();

            string test = app.DesignProjectManager.ActiveDesignProject.ContentCenterPath;

            Assert.IsTrue(PathShim.IsContentCenterPath(test, ref app));
        }
Exemplo n.º 12
0
        public void BadInput_Empty()
        {
            Inventor.Application app = ApplicationShim.Instance();

            var test = "";

            Assert.IsFalse(PathShim.IsLibraryPath(test, ref app));
        }
Exemplo n.º 13
0
        public void BadInput_WrongPath()
        {
            Inventor.Application app = ApplicationShim.Instance();

            var test = @"C:\Zarthastoriatarigula\the\fiverth";

            Assert.IsFalse(PathShim.IsLibraryPath(test, ref app));
        }
Exemplo n.º 14
0
        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));
        }
Exemplo n.º 15
0
        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));
        }
Exemplo n.º 16
0
        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;
            }
        }
Exemplo n.º 17
0
 public void UpOneLevel_MultipleInputs(string stringA, string stringB)
 {
     Assert.AreEqual(PathShim.UpOneLevel(stringA), stringB);
 }
Exemplo n.º 18
0
 public void GoodInput_TrailingSlash(string testA, string testB)
 {
     Assert.AreEqual(PathShim.TrimEndingDirectorySeparator(testA), testB);
 }