public void Test_Writing_An_Instance_Of_A_Tree_With_Height_3() { IDataNode rootNode = TreeWithHeight3.Build(); TreeWithHeight3.Class value = new TreeWithHeight3.Class { Child1 = new TreeWithHeight2.Class { Long = 1, Child = new TreeWithHeight1.Class { Int = 2, Float = 3.5f, Byte = 4 } }, Child2 = new TreeWithHeight2.Class { Long = 5, Child = new TreeWithHeight1.Class { Int = 6, Float = 7.5f, Byte = 8 } } }; treeWriter.Write(binaryWriter, value, rootNode) .Should() .BeEmpty(); Received.InOrder(() => VerifyWriteTreeWithHeight3(rootNode, value)); }
public void Test_Reading_An_Instance_Of_A_Tree_With_Height_3() { IDataNode rootNode = TreeWithHeight3.Build(); TreeWithHeight3.Class expected = new TreeWithHeight3.Class { Child1 = new TreeWithHeight2.Class { Long = 1, Child = new TreeWithHeight1.Class { Int = 2, Float = 3.5f, Byte = 4 } }, Child2 = new TreeWithHeight2.Class { Long = 5, Child = new TreeWithHeight1.Class { Int = 6, Float = 7.5f, Byte = 8 } } }; SetupTreeWithHeight3(rootNode, expected); object result = treeReader.Read(binaryReader, rootNode); Received.InOrder(() => VerifyReadTreeWithHeight3(rootNode)); result.Should().BeEquivalentTo(expected); }