Beispiel #1
0
        public void AsLine_withNoAttributes_includesText()
        {
            const string Text      = "Sample";
            var          statement = new DotStatement(Text);

            Assert.That(statement.AsText(), Is.StringContaining(Text));
        }
Beispiel #2
0
        public void AsLine_withNoAttributes_hasNoAttributeListClose()
        {
            const string Text      = "Sample";
            var          statement = new DotStatement(Text);

            Assert.That(statement.AsText(), Is.Not.StringContaining("]"));
        }
Beispiel #3
0
        public void Constructor_givenStatement_setsProperty()
        {
            const string s         = "sample";
            var          statement = new DotStatement(s);

            Assert.That(statement.Text, Is.EqualTo(s));
        }
Beispiel #4
0
 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"));
 }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        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"));
        }
Beispiel #7
0
        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));
        }
Beispiel #8
0
 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));
 }
Beispiel #9
0
        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));
        }
Beispiel #10
0
        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()));
        }
Beispiel #11
0
 public void Constructor_givenStatement_setsProperty()
 {
     const string s = "sample";
     var statement = new DotStatement(s);
     Assert.That(statement.Text, Is.EqualTo(s));
 }
Beispiel #12
0
 public void AsLine_withNoAttributes_includesText()
 {
     const string Text = "Sample";
     var statement = new DotStatement(Text);
     Assert.That(statement.AsText(), Is.StringContaining(Text));
 }
Beispiel #13
0
 public void AsLine_withNoAttributes_hasNoAttributeListOpen()
 {
     const string Text = "Sample";
     var statement = new DotStatement(Text);
     Assert.That(statement.AsText(), Is.Not.StringContaining("["));
 }