Пример #1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            var currentItem = (MenuElementTemplate)templatesDropdown.SelectedItem;
            var element     = new MenuElement(currentItem);

            graphWindow.AddElement(element.Element);
            elementsList.Items.Add(element);
        }
        public void AddElement_IsParent_Test_AddsElement_True()
        {
            var window = new GraphWindow(1000, 1000, "Test", Color.White, Color.Black, 10);
            var sine   = new SineWave(1, 1);

            window.AddElement(sine);

            Assert.IsTrue(window.IsParentOf(sine));
        }
        public void GetElements_ValidElements_True()
        {
            var window = new GraphWindow(1000, 1000, "Test", Color.White, Color.Black, 10);
            var sine   = new SineWave(1, 1);

            window.AddElement(sine);
            var elements = window.GetElements();

            Assert.IsTrue(elements.Length == 1);
            Assert.IsTrue(elements[0] == sine);
        }