本文整理汇总了C#中Get.CreateExtras方法的典型用法代码示例。如果您正苦于以下问题:C# Get.CreateExtras方法的具体用法?C# Get.CreateExtras怎么用?C# Get.CreateExtras使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Get
的用法示例。
在下文中一共展示了Get.CreateExtras方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: When_Type_Is_String_DataFormat_String_Is_Used
public void When_Type_Is_String_DataFormat_String_Is_Used()
{
var key = "When_Type_Is_String_DataFormat_String_Is_Used";
//delete the value if it exists
var delete = new Delete(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
IOStrategy.Execute(delete);
//Add the key
var add = new Add<string>(key, "foo", GetVBucket(), Transcoder, OperationLifespanTimeout);
Assert.IsTrue(IOStrategy.Execute(add).Success);
var get = new Get<string>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
get.CreateExtras();
Assert.AreEqual(DataFormat.String, get.Format);
var result = IOStrategy.Execute(get);
Assert.IsTrue(result.Success);
Assert.AreEqual(DataFormat.String, get.Format);
}
示例2: When_Type_Is_ByteArray_DataFormat_Binary_Is_Used
public void When_Type_Is_ByteArray_DataFormat_Binary_Is_Used()
{
var key = "When_Type_Is_Object_DataFormat_Json_Is_Used";
//delete the value if it exists
var delete = new Delete(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
IOStrategy.Execute(delete);
//Add the key
var add = new Add<byte[]>(key, new byte[] { 0x0 }, GetVBucket(), Transcoder, OperationLifespanTimeout);
Assert.IsTrue(IOStrategy.Execute(add).Success);
var get = new Get<byte[]>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
get.CreateExtras();
Assert.AreEqual(DataFormat.Binary, get.Format);
var result = IOStrategy.Execute(get);
Assert.IsTrue(result.Success);
Assert.AreEqual(DataFormat.Binary, get.Format);
}
示例3: When_Type_Is_Object_DataFormat_Json_Is_Used
public void When_Type_Is_Object_DataFormat_Json_Is_Used()
{
var key = "When_Type_Is_Object_DataFormat_Json_Is_Used";
//delete the value if it exists
var delete = new Delete(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
IOService.Execute(delete);
//Add the key
var add = new Add<dynamic>(key, new { foo = "foo" }, GetVBucket(), Transcoder, OperationLifespanTimeout);
Assert.IsTrue(IOService.Execute(add).Success);
var get = new Get<dynamic>(key, GetVBucket(), Transcoder, OperationLifespanTimeout);
get.CreateExtras();
Assert.AreEqual(DataFormat.Json, get.Format);
var result = IOService.Execute(get);
Assert.IsTrue(result.Success);
Assert.AreEqual(DataFormat.Json, get.Format);
}