예제 #1
0
        private void AddRequirementButtonHandler(object sender, RoutedEventArgs e)
        {
            Button addButton   = (Button)sender;
            var    module      = (Module)addButton.DataContext;
            var    requirement = new Requirement()
            {
                Title     = "New Requirement",
                Details   = "New Requirement Details",
                TestCases = new List <Test>()
            };

            module.Requirements.Add(requirement);
            LoadModules();
            foreach (Expander m in ModuleExpanders.Children)
            {
                m.IsExpanded = true;
            }
            DisplayRequirement(requirement);
            SaveProject();
        }
예제 #2
0
        private void DisplayRequirement(Requirement requirement)
        {
            _selectedModule      = _project.Modules.FirstOrDefault(x => x.Requirements.Contains(requirement));
            _selectedRequirement = requirement;

            //Clear Side Panel
            TestCases.Children.Clear();

            //Show Selected Details
            RequirementTitle.Text   = requirement.Title;
            RequirementDetails.Text = requirement.Details;

            foreach (var testCase in requirement.TestCases)
            {
                var tcButton = new Button()
                {
                    Content     = testCase.TestName,
                    DataContext = testCase,
                    Margin      = new Thickness(0, 2, 0, 2)
                };
                TestCases.Children.Add(tcButton);
            }
        }
예제 #3
0
        private void RequirementButtonHandler(object sender, RoutedEventArgs e)
        {
            Requirement req = (Requirement)((Button)sender).DataContext;

            DisplayRequirement(req);
        }