public void CanAddFormattedLabeledValueAsLabeledValueStruct() { AssertionFailureBuilder builder = new AssertionFailureBuilder("Description"); builder.AddLabeledValue(new AssertionFailure.LabeledValue("Abc", new StructuredText("123"))); Assert.AreElementsEqual(new[] { new AssertionFailure.LabeledValue("Abc", new StructuredText("123")) }, builder.ToAssertionFailure().LabeledValues); }
public void CanAddFormattedLabeledValueAsPlainTextString() { AssertionFailureBuilder builder = new AssertionFailureBuilder("Description"); builder.AddLabeledValue("Abc", "123"); Assert.AreElementsEqual(new[] { new AssertionFailure.LabeledValue("Abc", "123") }, builder.ToAssertionFailure().LabeledValues); }
public void AddLabeledValueWithStructuredTextThrowsIfFormattedValueIsNull() { AssertionFailureBuilder builder = new AssertionFailureBuilder("Description"); Assert.Throws <ArgumentNullException>(() => builder.AddLabeledValue("xxx", (StructuredText)null)); }
public void AddLabeledValueWithStructuredTextThrowsIfLabelIsNull() { AssertionFailureBuilder builder = new AssertionFailureBuilder("Description"); Assert.Throws <ArgumentNullException>(() => builder.AddLabeledValue(null, new StructuredText("abc"))); }