public void Indent_IndentStringShouldOnlyIncludeSpaceChar(uint level) { var indent = URScript.Indent(level); for (int i = 0; i < indent.Length; i++) { Assert.Equal(' ', indent[i]); } }
public void Indent_IndentStringLengthShouldBeCorrect(uint level) { var indent = URScript.Indent(level); var expected = (int)level * 2; var actual = indent.Length; Assert.Equal(expected, actual); }
public void ForceMode_ShouleHaveCorrectIndent(uint level) { URPose start = new URPose(new Point3D(0, 1, 2), new Point3D(0, 0, 0)); URPose end = new URPose(new Point3D(1, 2, 3), new Point3D(0, 0, 0)); URMovement movement = new URMovement(start, end); var cmds = URScript.ForceMode(level, movement).Split('\n'); //skip last line since it is empty line for (int i = 0; i < cmds.Length - 1; i++) { Assert.StartsWith(URScript.Indent(level), cmds[i]); Assert.NotEqual(' ', cmds[i][(int)level * 2]); } }