From c509100b09e84de64d1c77f3ff92e4a5b011f65b Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Tue, 17 May 2022 11:51:46 -0700 Subject: [PATCH] fixing tests --- .../ExportItemWindowTests.cs | 16 +++++++------- .../PartPreviewTests.cs | 22 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs b/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs index bac7705f6..cda4f0128 100644 --- a/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs +++ b/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs @@ -142,14 +142,14 @@ namespace MatterHackers.MatterControl.Tests.Automation "M109 S205", "G1 X5 Y5 Z3.13 F1800", "G92 E0 ; Purge line", - "G1 X5.83 Y5 Z3.04 E0.833 F900", - "G1 X6.67 Y5 Z2.96 E1.667", - "G1 X7.5 Y5 Z2.87 E2.5", - "G1 X8.33 Y5 Z2.79 E3.333", - "G1 X9.17 Y5 Z2.7 E4.167", - "G1 X10 Y5 Z2.62 E5", + "G1 X5.83 Z3.04 E0.833 F900", + "G1 X6.67 Z2.96 E1.667", + "G1 X7.5 Z2.87 E2.5", + "G1 X8.33 Z2.79 E3.333", + "G1 X9.17 Z2.7 E4.167", + "G1 X10 Z2.62 E5", "G92 E0 ; Purge line", - "G1 X10 Y5 Z2.62 E-2 F2400", + "G1 E-2 F2400", "M75 ; start print timer", }; @@ -193,7 +193,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { for (int j = 0; j < expectedLines.Length; j++) { - Assert.AreEqual(actualLines[i + j], expectedLines[j], "All lines should match"); + Assert.AreEqual(expectedLines[j], actualLines[i + j], "All lines should match"); // Debug.WriteLine("\"" + actualLines[i + j] + "\","); } diff --git a/Tests/MatterControl.AutomationTests/PartPreviewTests.cs b/Tests/MatterControl.AutomationTests/PartPreviewTests.cs index 59c8fabf1..d356d36a3 100644 --- a/Tests/MatterControl.AutomationTests/PartPreviewTests.cs +++ b/Tests/MatterControl.AutomationTests/PartPreviewTests.cs @@ -235,23 +235,23 @@ namespace MatterHackers.MatterControl.Tests.Automation // Verify grouping parts creates a group. testRunner.ClickByName("Group Button"); Assert.AreEqual(partCount - 1, scene.Children.Count, "Should have {0} parts after group", partCount - 1); - Assert.IsInstanceOf(scene.SelectedItem, "Scene selection should be group"); - Assert.IsInstanceOf(designTree.SelectedNode.Tag, "Group should be selected in design tree"); + Assert.IsInstanceOf(scene.SelectedItem, "Scene selection should be group"); + Assert.IsInstanceOf(designTree.SelectedNode.Tag, "Group should be selected in design tree"); Assert.AreSame(scene.SelectedItem, designTree.SelectedNode.Tag, "Same group object should be selected in scene and design tree"); treeNodes = FetchTreeNodes(); Assert.AreEqual(scene.Children.Count, treeNodes.Count, "Scene part count should equal tree node count after group"); - Assert.IsTrue(treeNodes.Any(node => node.Tag is GroupObject3D), "Design tree should have node for group"); - Assert.AreSame(designTree.SelectedNode.Tag, treeNodes.Single(node => node.Tag is GroupObject3D).Tag, "Selected node in design tree should be group node"); + Assert.IsTrue(treeNodes.Any(node => node.Tag is GroupHolesAppliedObject3D), "Design tree should have node for group"); + Assert.AreSame(designTree.SelectedNode.Tag, treeNodes.Single(node => node.Tag is GroupHolesAppliedObject3D).Tag, "Selected node in design tree should be group node"); - var groupNode = treeNodes.Where(node => node.Tag is GroupObject3D).Single(); + var groupNode = treeNodes.Where(node => node.Tag is GroupHolesAppliedObject3D).Single(); Assert.AreEqual(2, groupNode.Nodes.Count, "Group should have 2 parts"); Assert.IsTrue( new HashSet(groupNode.Nodes.Select(node => ((IObject3D)node.Tag).Name)).SetEquals(new[] {"Half Cylinder", "Pyramid"}), "Half Cylinder and Pyramind should be grouped"); var singleItemNodes = treeNodes - .Where(node => !(node.Tag is GroupObject3D)) + .Where(node => !(node.Tag is GroupHolesAppliedObject3D)) .Where(node => !(node.Tag is SelectionGroupObject3D)) .ToList(); var singleItemNames = new HashSet(singleItemNodes.Select(item => ((IObject3D)item.Tag).Name)); @@ -274,7 +274,7 @@ namespace MatterHackers.MatterControl.Tests.Automation // Verify control-clicking a part in the group does not get added to the selection group. Only top-level nodes can be // selected. treeNodes = FetchTreeNodes(); - groupNode = treeNodes.Where(node => node.Tag is GroupObject3D).Single(); + groupNode = treeNodes.Where(node => node.Tag is GroupHolesAppliedObject3D).Single(); testRunner.PressModifierKeys(AutomationRunner.ModifierKeys.Control) .ClickWidget(groupNode.Nodes.Last()) .ReleaseModifierKeys(AutomationRunner.ModifierKeys.Control); @@ -301,7 +301,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.IsInstanceOf(scene.SelectedItem, "Selected item should be a selection group after control-clicking on group"); Assert.AreEqual(3, scene.SelectedItem.Children.Count, "Selection should have 3 items after control-clicking on group"); Assert.IsTrue( - new HashSet(scene.SelectedItem.Children.Select(child => child.Name)).SetEquals(new[] {"Half Wedge", "Sphere", "Group"}), + new HashSet(scene.SelectedItem.Children.Select(child => child.Name)).SetEquals(new[] {"Half Wedge", "Sphere", "Half Cylinder, Pyramid" }), "Selection should have Group, Half Wedge, Sphere"); //===========================================================================================// @@ -316,14 +316,14 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.IsInstanceOf(scene.SelectedItem, "Selection group should exist after removing a child"); Assert.AreEqual(2, scene.SelectedItem.Children.Count, "Selection should have 2 parts after removing a child"); Assert.IsTrue( - new HashSet(scene.SelectedItem.Children.Select(child => child.Name)).SetEquals(new[] {"Group", "Sphere"}), + new HashSet(scene.SelectedItem.Children.Select(child => child.Name)).SetEquals(new[] { "Half Cylinder, Pyramid", "Sphere"}), "Group and Sphere should be in selection after removing a child"); //===========================================================================================// // Verify control-clicking on second-to-last part in the selection removes it from the selection // and destroys selection group. treeNodes = FetchTreeNodes(); - groupNode = treeNodes.Where(node => node.Tag is GroupObject3D).Single(); + groupNode = treeNodes.Where(node => node.Tag is GroupHolesAppliedObject3D).Single(); sphereNode = treeNodes.Where(node => ((IObject3D)node.Tag).Name == "Sphere").Single(); testRunner.PressModifierKeys(AutomationRunner.ModifierKeys.Control) @@ -349,7 +349,7 @@ namespace MatterHackers.MatterControl.Tests.Automation .ReleaseModifierKeys(AutomationRunner.ModifierKeys.Control); treeNodes = FetchTreeNodes(); - groupNode = treeNodes.Where(node => node.Tag is GroupObject3D).Single(); + groupNode = treeNodes.Where(node => node.Tag is GroupHolesAppliedObject3D).Single(); testRunner.PressModifierKeys(AutomationRunner.ModifierKeys.Control) .ClickWidget(groupNode.Nodes.Last()) .ReleaseModifierKeys(AutomationRunner.ModifierKeys.Control);