示例#1
0
        public void HierarchyTreeWorks_TwoLevel()
        {
            var           hierarchy = GetTypicalExample();
            HierarchyTree tree      = new HierarchyTree(hierarchy);
            string        result    = tree.ToString();

            result.Should().Be(twoLevelExpected);
        }
示例#2
0
        public async ValueTask HierarchyTreeWorksAsync_TwoLevel()
        {
            var           hierarchy = GetTypicalExample();
            HierarchyTree tree      = await HierarchyTree.ConstructAsync(hierarchy);

            string result = tree.ToString();

            result.Should().Be(twoLevelExpected);
        }
示例#3
0
        public void HierarchyTreeWorks_Larger()
        {
            var hierarchy = GetHierarchy(0, 1, 2, 0, 0);

            hierarchy.MyChild1.MyWrapperContainer = new WrapperContainer()
            {
                WrappedInt = 17
            };
            HierarchyTree tree     = new HierarchyTree(hierarchy);
            string        result   = tree.ToString();
            string        expected =
                $@"LazinatorTests.Examples.Example
    MyNullableDouble: 3.5
    MyBool: True
    MyChar: b
    MyDateTime: 1/1/2000 12:00:00 AM
    MyNewString: NULL
    MyNullableDecimal: -2341.5212352
    MyNullableTimeSpan: 03:00:00
    MyOldString: NULL
    MyString: this is a very long way of saying hello, world
    MyStringUncompressed: this is a very long way of saying hello, world
    MyTestEnum: MyTestValue2
    MyTestEnumByteNullable: NULL
    MyUInt: 2342343242
    MyNonLazinatorChild: NULL
    IncludableChild: NULL
    MyChild1: LazinatorTests.Examples.ExampleChild
        MyLong: 123123
        MyShort: 543
        ByteSpan: System.ReadOnlyMemory<Byte>[0]
        MyExampleGrandchild: LazinatorTests.Examples.ExampleGrandchild
            AString: hello
            MyInt: 123
        MyWrapperContainer: LazinatorTests.Examples.Structs.WrapperContainer
            WrappedInt: 17
                WrappedValue: 17
    MyChild2: LazinatorTests.Examples.ExampleChild
        MyLong: 999888
        MyShort: -23
        ByteSpan: System.ReadOnlyMemory<Byte>[0]
        MyExampleGrandchild: LazinatorTests.Examples.ExampleGrandchild
            AString: x
            MyInt: 3456345
        MyWrapperContainer: NULL
    MyChild2Previous: NULL
    MyInterfaceImplementer: NULL
    WrappedInt: 5
        WrappedValue: 5
    ExcludableChild: NULL
";

            result.Should().Be(expected);
        }