public void AsLine_withNoAttributes_includesText() { const string Text = "Sample"; var statement = new DotStatement(Text); Assert.That(statement.AsText(), Is.StringContaining(Text)); }
public void AsLine_withNoAttributes_hasNoAttributeListClose() { const string Text = "Sample"; var statement = new DotStatement(Text); Assert.That(statement.AsText(), Is.Not.StringContaining("]")); }
public void Constructor_givenStatement_setsProperty() { const string s = "sample"; var statement = new DotStatement(s); Assert.That(statement.Text, Is.EqualTo(s)); }
public void AsLine_withTwoAttributes_hasGapBetween() { var statement = new DotStatement("sample") .AddAttribute("color", "green") .AddAttribute("size", "large"); Assert.That( statement.AsText(), Has.No.StringContaining("green\"size")); }
public void AddAttribute_fullySpecified_returnsDotStatementWithAttribute() { const string Attribute = "color"; const string Value = "red"; var statement = new DotStatement("text") .AddAttribute(Attribute, Value); Assert.That(statement.AttributeValue(Attribute), Is.EqualTo(Value)); }
public void AsLine_withAttribute_hasAttributeName() { const string Attribute = "Color"; const string Color = "Green"; var statement = new DotStatement("Sample") .AddAttribute(Attribute, Color); Assert.That( statement.AsText(), Is.StringContaining(Attribute) & Is.StringContaining(Color)); }
public void AsText_withStatement_includesStatementText() { var sampleStatement = new DotStatement("Sample") .AddAttribute("Color", "Red"); var innerStatements = new List <IDotStatement> { sampleStatement }; var statement = new DotStatementBlock("Block", innerStatements); Assert.That( statement.AsText(), Is.StringContaining(sampleStatement.AsText())); }
public void AsLine_withNoAttributes_hasNoAttributeListOpen() { const string Text = "Sample"; var statement = new DotStatement(Text); Assert.That(statement.AsText(), Is.Not.StringContaining("[")); }