public void Test_SubGridTreeLeafBitmapSubGrid_ReadWrite() { var leaf = new SubGridTreeLeafBitmapSubGrid(); leaf.Bits.SetBit(10, 10); var newLeaf = new SubGridTreeLeafBitmapSubGrid(); using (var ms = new MemoryStream(Consts.TREX_DEFAULT_MEMORY_STREAM_CAPACITY_ON_CREATION)) { using (var bw = new BinaryWriter(ms)) { leaf.Write(bw); ms.Position = 0; using (var br = new BinaryReader(ms)) { newLeaf.Read(br); } } } newLeaf.Should().BeEquivalentTo(leaf); newLeaf.Bits[10, 10].Should().BeTrue(); newLeaf.Bits[10, 10].Should().Be(leaf.Bits[10, 10]); }
public void Test_SubGridTreeLeafBitmapSubGrid_Creation_OwnerParentLevel() { var subGrid = new SubGridTreeLeafBitmapSubGrid(null, null, SubGridTreeConsts.SubGridTreeLevels - 1); subGrid.Should().NotBeNull(); subGrid.Owner.Should().BeNull(); subGrid.Parent.Should().BeNull(); subGrid.Level.Should().Be(SubGridTreeConsts.SubGridTreeLevels - 1); }
public void Test_SubGridTreeLeafBitmapSubGrid_SubGridTreeLeafBitmapSubGrid() { var leaf = new SubGridTreeLeafBitmapSubGrid(); leaf.Should().NotBeNull(); }