Esempio n. 1
0
            public void It_expands_fields_of_objects()
            {
                var formatter = PlainTextFormatter <SomeStruct> .Create();

                var today    = DateTime.Today;
                var tomorrow = DateTime.Today.AddDays(1);
                var id       = new SomeStruct
                {
                    DateField    = today,
                    DateProperty = tomorrow
                };

                var output = id.ToDisplayString(formatter);

                output.Should().Contain("DateField: ");
                output.Should().Contain("DateProperty: ");
            }
Esempio n. 2
0
        public virtual void GenerateForAllMembers_expands_fields_of_objects()
        {
            var write = Formatter <SomeStruct> .GenerateForAllMembers();

            var today    = DateTime.Today;
            var tomorrow = DateTime.Today.AddDays(1);
            var id       = new SomeStruct
            {
                DateField    = today,
                DateProperty = tomorrow
            };
            var writer = new StringWriter();

            write(id, writer);
            var value = writer.ToString();

            value.Should().Contain("DateField: ");
            value.Should().Contain("DateProperty: ");
        }