示例#1
0
        public void ScriptDesignerViewModel_Constructor_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestJavaScriptDesignerViewModel(modelItem);

            Assert.IsTrue(viewModel.EscapeScript);
            Assert.IsTrue(viewModel.HasLargeView);
        }
示例#2
0
        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);
        }
示例#3
0
        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));
        }