public override XmlElement SerializeData(XmlDocument doc) { XmlElement element = base.SerializeData(doc); element.SetAttribute("mass", string.Empty, Mass.ToString("G4")); element.SetAttribute("drag", string.Empty, Drag.ToString("G4")); element.SetAttribute("angular-drag", string.Empty, AngularDrag.ToString("G4")); element.SetAttribute("use-gravity", string.Empty, UseGravity.ToString()); element.SetAttribute("constraints", string.Empty, Constraints.ToString()); return(element); }
public void ParseTest() { string input = testClick.ToString() + "\n"; input += testHover.ToString() + "\n"; input += testDrag.ToString() + "\n"; input += testKeystroke.ToString() + "\n"; AutoClickerParser parser = SetUp(input.ToString()); AutoClickerParser.InstructionsContext context = parser.instructions(); AutoClickerVisitor visitor = new AutoClickerVisitor(); List <Instructions.Instruction> instructions = (List <Instructions.Instruction>)visitor.Visit(context); Assert.IsTrue(instructions.Contains(testClick)); Assert.IsTrue(instructions.Contains(testHover)); Assert.IsTrue(instructions.Contains(testDrag)); Assert.IsTrue(instructions.Contains(testKeystroke)); }