コード例 #1
0
        private void New_Sequence_Button_Click(object sender, RoutedEventArgs e)
        {
            object element = this.viewModel.RoboViewModel.SelectedNode;

            if (element != null && element.GetType().Name.Equals("TestSuitViewModel"))
            {
                TestSuitViewModel     elementModel = (TestSuitViewModel)element;
                TestSequenceViewModel newSequence  = new TestSequenceViewModel();
                newSequence.Name        = "3rd Sequence";
                newSequence.Description = "3rd Sequence desc";

                elementModel.AllCollection.Add(newSequence);

                elementModel.IsExpanded = true;
                //newSequence.IsSelected = true;
            }
            else
            {
                MessageBox.Show("Please select the suit under which new sequence to be added.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
コード例 #2
0
        public bool Serialize(XmlTextWriter w, RoboViewModel robo)
        {
            this.writer = w;

            Type suitCollectionType       = new ObservableCollection <TestSuitViewModel>().GetType();
            Type sequenceCollectionType   = new ObservableCollection <TestSequenceViewModel>().GetType();
            Type stepCollectionType       = new ObservableCollection <TestStepViewModel>().GetType();
            Type appsCollectionType       = new ObservableCollection <AppsViewModel>().GetType();
            Type dataSourceCollectionType = new ObservableCollection <DataSourceViewModel>().GetType();
            Type variableCollectionType   = new ObservableCollection <VariableViewModel>().GetType();
            Type stringType = string.Empty.GetType();
            Type boolType   = bool.TrueString.GetType();
            Type intType    = int.MinValue.GetType();
            Type doubleType = double.MinValue.GetType();
            Type suitType   = new TestSuitViewModel().GetType();
            Type seqType    = new TestSequenceViewModel().GetType();
            Type stepType   = new TestStepViewModel().GetType();
            Type appType    = new AppsViewModel().GetType();
            Type dsType     = new DataSourceViewModel().GetType();
            Type varType    = new VariableViewModel().GetType();

            Type[] types = { suitCollectionType,       sequenceCollectionType, stepCollectionType, appsCollectionType,
                             dataSourceCollectionType, variableCollectionType, stringType,         boolType,          intType, doubleType,
                             suitType,                 seqType,                stepType,           appType,           dsType,  varType };

            writer.WriteStartDocument(true);
            writer.Formatting  = Formatting.Indented;
            writer.Indentation = 2;
            writer.WriteStartElement("Suits");

            AppendNodeRobo(types, robo);

            writer.WriteEndElement();
            writer.WriteEndDocument();
            writer.Close();
            return(true);
        }
コード例 #3
0
        internal static void DealWithTestSeqViewModel(TestSequenceViewModel TSModel, Grid grid, TreeView TestCaseTreeView)
        {
            main_grid        = grid;
            testCaseTreeView = TestCaseTreeView;

            string name = TSModel.Name;
            string desc = TSModel.Description;

            Label labelName = new Label();

            labelName.Content = "Name";
            addToGrid(main_grid, labelName, 0, true);

            TextBox txtName = new TextBox();

            txtName.Text = name;
            txtName.Name = "Name";
            addToGrid(main_grid, txtName, 1, false);


            Label labelDesc = new Label();

            labelDesc.Content = "Description";
            addToGrid(main_grid, labelDesc, 0, true);

            TextBox txtDesc = new TextBox();

            txtDesc.TextWrapping = TextWrapping.Wrap;
            txtDesc.Name         = "Description";
            txtDesc.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
            txtDesc.MinHeight = 70;
            txtDesc.Text      = desc;
            addToGrid(main_grid, txtDesc, 1, false);

            main_grid.LostFocus += new RoutedEventHandler(TestSeqDetailsEdited);
        }
コード例 #4
0
 public void Init()
 {
     _fakeDriver            = A.Fake <IGeccoDriver>();
     DriverContainer.Driver = _fakeDriver;
     _sut = new TestSequenceViewModel();
 }