当前位置: 首页>>代码示例>>C#>>正文


C# Get.ReadExtras方法代码示例

本文整理汇总了C#中Get.ReadExtras方法的典型用法代码示例。如果您正苦于以下问题:C# Get.ReadExtras方法的具体用法?C# Get.ReadExtras怎么用?C# Get.ReadExtras使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Get的用法示例。


在下文中一共展示了Get.ReadExtras方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_ReadExtras_When_Type_Is_Binary

        public void Test_ReadExtras_When_Type_Is_Binary()
        {
            var key = "binkey";
            var expected = new byte[]
            {
                0x81, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x0e, 0xa2, 0x9d, 0x32, 0xdb, 0xb5, 0x03, 0x00, 0x00, 0x02, 0x01, 0x02, 0x03, 0x04
            };

            var get = new Get<byte[]>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
            get.ReadExtras(expected);
            Assert.AreEqual(DataFormat.Binary, get.Format);
        }
开发者ID:brantburnett,项目名称:couchbase-net-client,代码行数:12,代码来源:OperationBaseTests.cs

示例2: Test_When_Type_Is_Int32

        public void Test_When_Type_Is_Int32()
        {
            var key = "intkey";
            var expected = new byte[]
            {
                81, 00, 00, 00, 04, 00, 00, 00, 00, 00, 00, 06, 00, 00, 00, 0x03, 00, 04, 0x0e, 0x9f, 43, 0xd8, 0xbd, 92, 02, 00, 00, 00, 31, 34
            };

            var get = new Get<int>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
            get.ReadExtras(expected);
            Assert.AreEqual(DataFormat.Json, get.Format);
        }
开发者ID:brantburnett,项目名称:couchbase-net-client,代码行数:12,代码来源:OperationBaseTests.cs

示例3: Test_When_Type_Is_String

        public void Test_When_Type_Is_String()
        {
            var key = "stringkey";
            var expected = new byte[]
            {
              81, 00, 00, 00, 04, 00, 00, 00, 00, 00, 00, 08, 00, 00, 00, 04, 00, 04, 0x0e, 0x9f, 43, 0xe8, 0x4b, 0xd4, 04, 00, 00, 04, 68, 69, 68, 0x6f
            };

            var get = new Get<string>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
            get.ReadExtras(expected);
            Assert.AreEqual(DataFormat.String, get.Format);
        }
开发者ID:brantburnett,项目名称:couchbase-net-client,代码行数:12,代码来源:OperationBaseTests.cs

示例4: Test_When_Type_Is_Number

        public void Test_When_Type_Is_Number()
        {
            var key = "numberkey";
            var expected = new byte[]
            {
                81, 00, 00, 00, 04, 00, 00, 00, 00, 00, 00, 0x0a, 00, 00, 00, 02, 00, 05, 0x4a, 10, 0xcd, 0xd3, 0x4c, 0x7e, 0x02, 00, 00, 00, 31, 34, 0x2e, 0x36, 36, 36
            };

            var get = new Get<decimal>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
            get.ReadExtras(expected);
            Assert.AreEqual(DataFormat.Json, get.Format);
        }
开发者ID:brantburnett,项目名称:couchbase-net-client,代码行数:12,代码来源:OperationBaseTests.cs

示例5: Test_When_Type_Is_Json

        public void Test_When_Type_Is_Json()
        {
            var key = "jsonkey";
            var expected = new byte[]
            {
                0x81, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x0e, 0x9f, 0x43, 0xcf, 0xbd, 0x33, 0x02, 0x00, 0x00, 0x00, 0x7b, 0x22, 0x78, 0x22, 0x3a, 0x22, 0x68, 0x69, 0x22, 0x2c, 0x22, 0x79, 0x22, 0x3a, 0x31, 0x34, 0x7d
            };

            var get = new Get<dynamic>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
            get.ReadExtras(expected);
            Assert.AreEqual(DataFormat.Json, get.Format);
        }
开发者ID:brantburnett,项目名称:couchbase-net-client,代码行数:12,代码来源:OperationBaseTests.cs


注:本文中的Get.ReadExtras方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。