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()); }
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); }
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()); }
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); }
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"); }
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); }
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); }
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)); }