public void ReadDynamicTravelTest()
        {
            var bytes = SerializationTestContext.GetFilledDataBlockBlob();
            var stream = new MemoryStream(bytes);
            var visitor = new PackedDataReadVisitor(stream);

            var context = new DynamicTravellerContext();
            var traveller = context.GetInstance<DataBlock>();

            var graph = new DataBlock();
            traveller.Travel(visitor, graph);

            var expected = DataBlock.Filled();
            AssertAreEqual(expected, graph);
        }
Ejemplo n.º 2
0
        public void ReadDynamicTravelTest()
        {
            var bytes   = BinarySerializationTestContext.GetFilledDataBlockBlob();
            var stream  = new MemoryStream(bytes);
            var visitor = new PackedDataReadVisitor(stream);

            var context   = new DynamicTravellerContext();
            var traveller = context.GetInstance <DataBlock>();

            var graph = new DataBlock();

            traveller.Travel(visitor, graph);

            var expected = DataBlock.Filled();

            graph.AssertEqualTo(expected);
        }
        public IGraphTraveller <T> CreateTraveller <T>()
        {
            var traveller = _travellerContext.GetInstance <T>();

            return(traveller);
        }
Ejemplo n.º 4
0
 public GraphTravellerCollection(DynamicTravellerContext context, IVisitArgsFactory visitArgsFactory)
     : this(t => context.GetInstance(t, visitArgsFactory))
 {
 }
Ejemplo n.º 5
0
 public GraphTravellerCollection(DynamicTravellerContext context)
     : this(t => context.GetInstance(t))
 {
 }