public void CreateFormatter_throws_when_an_expression_is_not_a_MemberExpression() { var formatter = new FormatterSet(); var ex = Assert.Throws <ArgumentException>(() => formatter.CreateFormatterFor <SomethingWithLotsOfProperties>( o => o.DateProperty.ToShortDateString(), o => o.StringProperty)); Assert.That(ex.Message, Contains.Substring("o => o.DateProperty.ToShortDateString()")); }
public void CreateFormatter_throws_when_an_expression_is_not_a_MemberExpression() { var formatter = new FormatterSet(); var ex = Assert.Throws<ArgumentException>(() => formatter.CreateFormatterFor<SomethingWithLotsOfProperties>( o => o.DateProperty.ToShortDateString(), o => o.StringProperty)); Assert.That(ex.Message, Contains.Substring("o => o.DateProperty.ToShortDateString()")); }