コード例 #1
0
        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()"));
        }
コード例 #2
0
ファイル: FormatterSetTests.cs プロジェクト: wli3/Its.Log
        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()"));
        }