예제 #1
0
        public void ScriptDesignerViewModel_Constructor_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestRubyDesignerViewModel(modelItem);

            Assert.IsTrue(viewModel.EscapeScript);
            Assert.IsTrue(viewModel.HasLargeView);
        }
예제 #2
0
        public void ScriptDesignerViewModel_SelectedScriptType_Ruby_PropertiesInitialized()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestRubyDesignerViewModel(modelItem);

            Assert.IsTrue(viewModel.EscapeScript);
            Assert.AreEqual("Ruby Syntax", viewModel.ScriptTypeDefaultText);
        }
예제 #3
0
        public void ScriptDesignerViewModel_ChooseDirectoryShould_ReturnFile()
        {
            var modelItem = CreateModelItem();
            var viewModel = new TestRubyDesignerViewModel(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));
        }