public void TestDelimitedStringBuilder() { DelimitedStringBuilder exceptions = new DelimitedStringBuilder(); Assert.IsTrue(exceptions.IsEmpty(), "No string built."); exceptions.Add("blah"); Assert.IsFalse(exceptions.IsEmpty(), "String built."); }
public void TestIsEmpty() { DelimitedStringBuilder builder = null; Assert.IsTrue(builder.IsEmpty(), "Null instance is empty."); builder = new DelimitedStringBuilder(); Assert.IsTrue(builder.IsEmpty(), "Empty contents is empty."); builder.AddIfNotEmpty(null); Assert.IsTrue(builder.IsEmpty(), "Adding null is supported but still empty."); builder.AddIfNotEmpty(""); Assert.IsTrue(builder.IsEmpty(), "Adding empty to this method is still empty."); builder.AddIfNotEmpty("something"); Assert.IsTrue(!builder.IsEmpty(), "Finally this is not empty."); }