Esempio n. 1
0
        public void Test_Projection_With_Dictionary()
        {
            var getRequest = new MultiLookup <byte[]>();

            getRequest.ReadAsync(new FakeMemoryOwner <byte>(_lookupInPacket));

            var readResult = new GetResult(new FakeMemoryOwner <byte>(_lookupInPacket),
                                           new DefaultTranscoder(new DefaultConverter()),
                                           _lookupInSpecs)
            {
                OpCode = OpCode.MultiLookup,
                Flags  = getRequest.Flags,
                Header = getRequest.Header
            };

            var result = readResult.ContentAs <Dictionary <string, dynamic> >();

            Assert.Equal(result["name"], "Emmy-lou Dickerson");
        }
        public void Test_Projection()
        {
            var getRequest = new MultiLookup <byte[]>();

            getRequest.ReadAsync(_lookupInPacket);

            var readResult = new GetResult(_lookupInPacket,
                                           new DefaultTranscoder(new DefaultConverter()),
                                           _lookupInSpecs)
            {
                OpCode = OpCode.MultiLookup,
                Flags  = getRequest.Flags,
                Header = getRequest.Header
            };

            var result = readResult.ContentAs <dynamic>();

            Assert.Equal("Emmy-lou Dickerson", result.name.Value);
        }
Esempio n. 3
0
        public void Test_Projection_With_Poco()
        {
            var getRequest = new MultiLookup <byte[]>();

            getRequest.ReadAsync(new FakeMemoryOwner <byte>(_lookupInPacket));

            var readResult = new GetResult(new FakeMemoryOwner <byte>(_lookupInPacket),
                                           new DefaultTranscoder(),
                                           _lookupInSpecs)
            {
                OpCode = OpCode.MultiLookup,
                Flags  = getRequest.Flags,
                Header = getRequest.Header
            };

            var result = readResult.ContentAs <Person>();

            Assert.Equal("Emmy-lou Dickerson", result.name);
        }
Esempio n. 4
0
        public void Test_Projection()
        {
            var getRequest = new MultiLookup <byte[]>();

            getRequest.ReadAsync(new FakeMemoryOwner <byte>(_lookupInPacket));

            var readResult = new GetResult(new FakeMemoryOwner <byte>(_lookupInPacket),
                                           new LegacyTranscoder(), new Mock <ILogger <GetResult> >().Object,
                                           _lookupInSpecs)
            {
                OpCode = OpCode.MultiLookup,
                Flags  = getRequest.Flags,
                Header = getRequest.Header
            };

            var result = readResult.ContentAs <dynamic>();

            Assert.Equal("Emmy-lou Dickerson", result.name.Value);
        }