Exemple #1
0
        public void PreferenceSettingsConnectorTypeRevertsToBezier()
        {
            // Arrange
            var preferences = new PreferenceSettings()
            {
                ConnectorType = ConnectorType.POLYLINE
            };

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                PathResolver    = pathResolver,
                StartInTestMode = true,
                ProcessMode     = TaskProcessMode.Synchronous,
                Preferences     = preferences,
            };

            // Act
            RestartTestSetupWithNewSettings(config, true);

            // Assert
            // Check that prefferenceSettings are set to ConnectorType.POLYLINE
            // but the Models connector type is BEZIER
            Assert.That(Model.PreferenceSettings.ConnectorType == ConnectorType.POLYLINE);
            Assert.That(Model.ConnectorType == ConnectorType.BEZIER);
        }
Exemple #2
0
        public void SetPythonTemplateFromConfigWithValidPath()
        {
            var templatePath = Path.Combine(SettingDirectory, "PythonTemplate-initial.py");

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                PythonTemplatePath = templatePath
            };

            var model = DynamoModel.Start(config);

            Assert.AreEqual(model.PreferenceSettings.PythonTemplateFilePath, templatePath);
        }
Exemple #3
0
        public void SetPythonTemplateFromConfigWithInvalidPath()
        {
            var templatePath = Path.Combine(@"C:\Users\SomeDynamoUser\Desktop", "PythonTemplate-initial.py");

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                PythonTemplatePath = templatePath
            };

            var model = DynamoModel.Start(config);

            Assert.AreEqual(model.PreferenceSettings.PythonTemplateFilePath, string.Empty);
        }
Exemple #4
0
        private static DynamoModel StartDynamoWithDefaultConfig(bool CLImode, string geometryFactoryPath, string preloaderLocation)
        {
            var config = new DynamoModel.DefaultStartConfiguration()
            {
                GeometryFactoryPath = geometryFactoryPath,
                ProcessMode         = TaskProcessMode.Asynchronous
            };

            config.UpdateManager   = CLImode ? null : InitializeUpdateManager();
            config.StartInTestMode = CLImode ? true : false;
            config.PathResolver    = CLImode ? new CLIPathResolver(preloaderLocation) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver;

            var model = DynamoModel.Start(config);

            return(model);
        }
Exemple #5
0
        public DynamoModel MakeModel()
        {
            var geometryFactoryPath = string.Empty;

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                GeometryFactoryPath = geometryFactoryPath,
                ProcessMode         = TaskProcessMode.Asynchronous
            };

            config.PathResolver = new SandboxPathResolver() as IPathResolver;

            var model = DynamoModel.Start(config);

            return(model);
        }
Exemple #6
0
        public static DynamoModel MakeModel(bool CLImode)
        {
            var geometryFactoryPath = string.Empty;
            var preloaderLocation   = string.Empty;

            PreloadShapeManager(ref geometryFactoryPath, ref preloaderLocation);

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                GeometryFactoryPath = geometryFactoryPath,
            };

            config.UpdateManager   = CLImode ? null : InitializeUpdateManager();
            config.StartInTestMode = CLImode ? true : false;
            config.PathResolver    = CLImode ? new CLIPathResolver(preloaderLocation) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver;

            var model = DynamoModel.Start(config);

            return(model);
        }
        public static DynamoModel MakeModel()
        {
            var geometryFactoryPath = string.Empty;
            var preloaderLocation   = string.Empty;

            PreloadShapeManager(ref geometryFactoryPath, ref preloaderLocation);

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                GeometryFactoryPath = geometryFactoryPath,
                ProcessMode         = TaskProcessMode.Asynchronous
            };

            //config.StartInTestMode = false;
            config.PathResolver = new SandboxPathResolver(preloaderLocation) as IPathResolver;

            var model = DynamoModel.Start(config);

            return(model);
        }
Exemple #8
0
        private static DynamoModel MakeModel(string nodeLibraryPath)
        {
            var version             = LibraryVersion.Version222;
            var libGFolderName      = string.Format("libg_{0}", ((int)version));
            var preloaderLocation   = Path.Combine(DynamoCorePath, libGFolderName);
            var geometryFactoryPath = Path.Combine(preloaderLocation, Utilities.GeometryFactoryAssembly);

            var config = new DynamoModel.DefaultStartConfiguration()
            {
                GeometryFactoryPath = geometryFactoryPath,
                ProcessMode         = TaskProcessMode.Asynchronous
            };

            config.UpdateManager   = null;
            config.StartInTestMode = false;

            config.PathResolver = new FusionPathResolver(nodeLibraryPath) as IPathResolver;

            var model = DynamoModel.Start(config);

            return(model);
        }