Inheritance: Dev2.Activities.Designers2.Script.ScriptDesignerViewModel
コード例 #1
0
 public void ScriptDesignerViewModel_Constructor_PropertiesInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestScriptDesignerViewModel(modelItem);
     var expected = Dev2EnumConverter.ConvertEnumsTypeToStringList<enScriptType>();
     CollectionAssert.AreEqual(expected.ToList(), viewModel.ScriptTypes.ToList());
 }
コード例 #2
0
 public void ScriptDesignerViewModel_SelectedScriptType_JavaScript_PropertiesInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestScriptDesignerViewModel(modelItem);
     Assert.AreEqual(enScriptType.JavaScript, viewModel.ScriptType);
     Assert.AreEqual("JavaScript", viewModel.SelectedScriptType);
     Assert.AreEqual("JavaScript Syntax", viewModel.ScriptTypeDefaultText);
 }
コード例 #3
0
        public void ScriptDesignerViewModel_Constructor_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestScriptDesignerViewModel(modelItem);
            var expected  = Dev2EnumConverter.ConvertEnumsTypeToStringList <enScriptType>();

            CollectionAssert.AreEqual(expected.ToList(), viewModel.ScriptTypes.ToList());
        }
コード例 #4
0
 public void ScriptDesignerViewModel_SelectedScriptType_Ruby_PropertiesInitialized()
 {
     var modelItem = CreateModelItem();
     var viewModel = new TestScriptDesignerViewModel(modelItem);
     const string ExpectedValue = "Ruby";
     viewModel.SelectedScriptType = ExpectedValue;
     Assert.AreEqual(enScriptType.Ruby, viewModel.ScriptType);
     Assert.AreEqual("Ruby Syntax", viewModel.ScriptTypeDefaultText);
 }
コード例 #5
0
        public void ScriptDesignerViewModel_UpdateHelpDescriptionShould_SetNewValue()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestScriptDesignerViewModel(modelItem);

            Assert.AreEqual(enScriptType.JavaScript, viewModel.ScriptType);
            Assert.AreEqual("JavaScript", viewModel.SelectedScriptType);
            viewModel.UpdateHelpDescriptor("Help me");
        }
コード例 #6
0
        public void ScriptDesignerViewModel_SelectedScriptType_JavaScript_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestScriptDesignerViewModel(modelItem);

            Assert.AreEqual(enScriptType.JavaScript, viewModel.ScriptType);
            Assert.AreEqual("JavaScript", viewModel.SelectedScriptType);
            Assert.AreEqual("JavaScript Syntax", viewModel.ScriptTypeDefaultText);
        }
コード例 #7
0
        public void ScriptDesignerViewModel_SelectedScriptType_Ruby_PropertiesInitialized()
        {
            var          modelItem     = CreateModelItem();
            var          viewModel     = new TestScriptDesignerViewModel(modelItem);
            const string ExpectedValue = "Ruby";

            viewModel.SelectedScriptType = ExpectedValue;
            Assert.AreEqual(enScriptType.Ruby, viewModel.ScriptType);
            Assert.AreEqual("Ruby Syntax", viewModel.ScriptTypeDefaultText);
        }
コード例 #8
0
        public void ScriptDesignerViewModel_SelectedScriptType_Python_PropertiesInitialized()
        {
            var          modelItem     = CreateModelItem();
            var          viewModel     = new TestScriptDesignerViewModel(modelItem);
            const string ExpectedValue = "Python";

            viewModel.SelectedScriptType = ExpectedValue;
            Assert.AreEqual(enScriptType.Python, viewModel.ScriptType);
            Assert.IsTrue(viewModel.EscapeScript);
            Assert.AreEqual("Python Syntax", viewModel.ScriptTypeDefaultText);
        }
コード例 #9
0
        public void ScriptDesignerViewModel_SelectedScriptType_JavaScript_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestScriptDesignerViewModel(modelItem);

            Assert.AreEqual(enScriptType.JavaScript, viewModel.ScriptType);
            Assert.AreEqual("JavaScript", viewModel.SelectedScriptType);
            Assert.IsTrue(viewModel.EscapeScript);
            Assert.IsTrue(string.IsNullOrEmpty(viewModel.IncludeFile));
            Assert.AreEqual("JavaScript Syntax", viewModel.ScriptTypeDefaultText);
        }
コード例 #10
0
        public void ScriptDesignerViewModel_ChooseDirectoryShould_ReturnFile()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestScriptDesignerViewModel(modelItem);

            Assert.AreEqual(enScriptType.JavaScript, viewModel.ScriptType);
            Assert.AreEqual("JavaScript", viewModel.SelectedScriptType);
            Assert.IsTrue(string.IsNullOrEmpty(viewModel.IncludeFile));
            viewModel.IncludeFile = GetJsTmpFile();
            viewModel.Validate();
            var command = new DelegateCommand(o => viewModel.ChooseScriptSources());

            Assert.IsTrue(viewModel.ChooseScriptSourceCommand.CanExecute(command));
            viewModel.ChooseScriptSourceCommand.Execute(command);
            Assert.IsFalse(string.IsNullOrEmpty(viewModel.IncludeFile));
        }