コード例 #1
0
        public void Static_properties_are_not_written()
        {
            var formatter = new FormatterSet();

            formatter.RegisterPropertiesFormatter <BoundaryTests.NestedWidget>();

            Assert.That(formatter.Format(new Widget()),
                        !Contains.Substring("StaticProperty"));
        }
コード例 #2
0
        public void RegisterPropertiesFormatter_for_string_does_nothing()
        {
            var formatter = new FormatterSet();

            formatter.RegisterPropertiesFormatter <string>();

            Assert.That(formatter.Format("hello"),
                        Is.EqualTo("hello"));
        }
コード例 #3
0
        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()"));
        }
コード例 #4
0
ファイル: FormatterSetTests.cs プロジェクト: wli3/Its.Log
        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()"));
        }
コード例 #5
0
ファイル: FormatterSetTests.cs プロジェクト: wli3/Its.Log
        public void Static_properties_are_not_written()
        {
            var formatter = new FormatterSet();
            formatter.RegisterPropertiesFormatter<BoundaryTests.NestedWidget>();

            Assert.That(formatter.Format(new Widget()),
                        !Contains.Substring("StaticProperty"));
        }
コード例 #6
0
ファイル: FormatterSetTests.cs プロジェクト: wli3/Its.Log
        public void RegisterPropertiesFormatter_for_string_does_nothing()
        {
            var formatter = new FormatterSet();
            formatter.RegisterPropertiesFormatter<string>();

            Assert.That(formatter.Format("hello"),
                        Is.EqualTo("hello"));
        }