public void Static_properties_are_not_written() { var formatter = new FormatterSet(); formatter.RegisterPropertiesFormatter <BoundaryTests.NestedWidget>(); Assert.That(formatter.Format(new Widget()), !Contains.Substring("StaticProperty")); }
public void RegisterPropertiesFormatter_for_string_does_nothing() { var formatter = new FormatterSet(); formatter.RegisterPropertiesFormatter <string>(); Assert.That(formatter.Format("hello"), Is.EqualTo("hello")); }
public void RegisterFormatter_throws_when_an_expression_is_not_a_MemberExpression() { var formatter = new FormatterSet(); var ex = Assert.Throws <ArgumentException>(() => formatter.RegisterPropertiesFormatter <SomethingWithLotsOfProperties>( o => o.DateProperty.ToShortDateString(), o => o.StringProperty)); Assert.That(ex.Message, Contains.Substring("o => o.DateProperty.ToShortDateString()")); }
public void RegisterFormatter_throws_when_an_expression_is_not_a_MemberExpression() { var formatter = new FormatterSet(); var ex = Assert.Throws<ArgumentException>(() => formatter.RegisterPropertiesFormatter<SomethingWithLotsOfProperties>( o => o.DateProperty.ToShortDateString(), o => o.StringProperty)); Assert.That(ex.Message, Contains.Substring("o => o.DateProperty.ToShortDateString()")); }
public void Static_properties_are_not_written() { var formatter = new FormatterSet(); formatter.RegisterPropertiesFormatter<BoundaryTests.NestedWidget>(); Assert.That(formatter.Format(new Widget()), !Contains.Substring("StaticProperty")); }
public void RegisterPropertiesFormatter_for_string_does_nothing() { var formatter = new FormatterSet(); formatter.RegisterPropertiesFormatter<string>(); Assert.That(formatter.Format("hello"), Is.EqualTo("hello")); }