예제 #1
0
        public void TestCreateCMakeLists()
        {
            string             tempDirectory  = CreateRandomTempDirectory();
            string             name           = Path.GetRandomFileName();
            URDFPackage        pkg            = new URDFPackage(name, tempDirectory);
            Mock <IMessageBox> messageBoxMock = new Mock <IMessageBox>();

            messageBoxMock.Setup(m => m.Show(It.IsAny <string>()))
            .Returns(MessageBoxResult.OK);     //can be whatever depends on test case
            URDFPackage.MessageBox = messageBoxMock.Object;
            pkg.CreateDirectories();
            pkg.CreateCMakeLists();

            Assert.True(File.Exists(pkg.WindowsCMakeLists));

            Console.WriteLine("Deleting directory " + tempDirectory);
            Directory.Delete(tempDirectory, true);
        }
예제 #2
0
        public void TestCreateDirectories()
        {
            string      tempDirectory = CreateRandomTempDirectory();
            string      name          = Path.GetRandomFileName();
            URDFPackage pkg           = new URDFPackage(name, tempDirectory);

            Mock <IMessageBox> messageBoxMock = new Mock <IMessageBox>();

            messageBoxMock.Setup(m => m.Show(It.IsAny <string>()))
            .Returns(MessageBoxResult.OK);     //can be whatever depends on test case
            URDFPackage.MessageBox = messageBoxMock.Object;
            pkg.CreateDirectories();

            Assert.True(Directory.Exists(pkg.WindowsPackageDirectory));
            Assert.True(Directory.Exists(pkg.WindowsMeshesDirectory));
            Assert.True(Directory.Exists(pkg.WindowsRobotsDirectory));
            Assert.True(Directory.Exists(pkg.WindowsTexturesDirectory));
            Assert.True(Directory.Exists(pkg.WindowsLaunchDirectory));
            Assert.True(Directory.Exists(pkg.WindowsConfigDirectory));

            Directory.Delete(tempDirectory, true);
        }