public void Line() { SvgCanvas canvas = new SvgCanvas("test", "2in", "2in"); canvas.Line(1, 2, 3, 4, 5, "black"); var s = canvas.ToSvg(); var document = XDocument.Parse(s); document.Root.Should().HaveElement(Name("line")) .Which .Should() .BeOfType <XElement>() .And.HaveAttribute("x1", "1") .And.HaveAttribute("y1", "2") .And.HaveAttribute("x2", "3") .And.HaveAttribute("y2", "4") .And.HaveAttribute("stroke", "black") .And.HaveAttribute("stroke-width", "5") .And.Match(xe => xe.Parent.Name == Name("svg")); }