public void ScriptDesignerViewModel_Constructor_PropertiesInitialized() { var modelItem = CreateModelItem(); var viewModel = new TestJavaScriptDesignerViewModel(modelItem); Assert.IsTrue(viewModel.EscapeScript); Assert.IsTrue(viewModel.HasLargeView); }
public void ScriptDesignerViewModel_SelectedScriptType_JavaScript_PropertiesInitialized() { var modelItem = CreateModelItem(); var viewModel = new TestJavaScriptDesignerViewModel(modelItem); 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 TestJavaScriptDesignerViewModel(modelItem); 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)); }