Exemplo n.º 1
0
 internal PropertyContext(
     Node node,
     IPstReader reader)
 {
     _node = node;
     _pstReader = reader;
     Initialize();
 }
Exemplo n.º 2
0
 internal TableContext(
     Node node,
     IPstReader reader)
 {
     _node = node;
     _reader = reader;
     Initialize();
 }
Exemplo n.º 3
0
 internal TcRow(
     int rowIndex,
     TcColumnOffsets offsets,
     TcColumnDef[] columnDefs,
     Segment<byte> rowData,
     Heap heap,
     Node node,
     IPstReader reader)
 {
     _rowIndex = rowIndex;
     _offsets = offsets;
     _columnDefs = columnDefs;
     _rowData = rowData;
     _heap = heap;
     _node = node;
     _reader = reader;
 }
Exemplo n.º 4
0
        public void Gets_Property_Value()
        {
            var expectedBytes = new byte[]
            {
                0x97, 0x7b, 0x45, 0xcb, 0xdb, 0xc2, 0x82, 0x43,
                0x92, 0x10, 0x55, 0x19, 0xe9, 0x93, 0x28, 0xfa
            };
            var reader = new Mock<IPstReader>();
            reader.Setup(r => r.FindBlock(0x1234))
                .Returns(Block.Create(_heapData));

            var node = new Node(0x21, 0x1234, 0x5678, reader.Object);
            var pc = new PropertyContext(node, reader.Object);

            var result = pc.Get(PropertyKey.RecordKey);

            CollectionAssert.AreEqual(expectedBytes, result.ToArray());
        }
Exemplo n.º 5
0
        public void Gets_Cell_Data(int rowIndex, PropertyKey key, byte[] expectedBytes)
        {
            var reader = new Mock<IPstReader>();
            reader.Setup(r => r.FindBlock(0x538))
                .Returns(Block.Create(_nodeData));
            reader.Setup(r => r.FindBlock(0x542))
                .Returns(Block.Create(_subNodeTree));
            reader.Setup(r => r.FindBlock(0x53c))
                .Returns(Block.Create(_subNodeData));

            var node = new Node(0x802d, 0x538, 0x542, reader.Object);
            var tc = new TableContext(node, reader.Object);

            var row = tc.Rows[rowIndex];
            CollectionAssert.AreEqual(expectedBytes, row.GetCell(key)?.ToArray());
        }
Exemplo n.º 6
0
 private void Initialize()
 {
     _node = _pstReader.FindNode(_nid);
     _context = new PropertyContext(_node, _pstReader);
 }