示例#1
0
        public void Test_ToString_Method_With_A_Class_Without_Values()
        {
            ToStringMethod <EmptyClass> toStringMethod = new ToStringMethodBuilder <EmptyClass>()
                                                         .UseProperties()
                                                         .Build();

            string result = toStringMethod(new EmptyClass());

            result.Should().Be("{}");
        }
示例#2
0
        public void Test_ToString_Method_With_A_Class_With_Private_And_Internal_Members()
        {
            var toString = new ToStringMethodBuilder <ClassWithMembersWithDifferentAccess>()
                           .UseFields()
                           .UseProperties()
                           .Build();

            string result = toString(new ClassWithMembersWithDifferentAccess());

            result.Should().Be("{}");
        }