本文整理汇总了C#中ExtendedDataCollection.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# ExtendedDataCollection.GetValue方法的具体用法?C# ExtendedDataCollection.GetValue怎么用?C# ExtendedDataCollection.GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtendedDataCollection
的用法示例。
在下文中一共展示了ExtendedDataCollection.GetValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Can_Deserialize_ExtendedData_To_Dictionary
public void Can_Deserialize_ExtendedData_To_Dictionary()
{
//// Arrange
var persisted = @"<?xml version=""1.0"" encoding=""utf-16""?><extendedData><key3>value3</key3><key2>value2</key2><key1>value1</key1><key5>value5</key5><key4>value4</key4></extendedData>";
//// Act
var extended = new ExtendedDataCollection(persisted);
//// Assert
Assert.IsTrue(5 == extended.Count);
Assert.AreEqual("value3", extended.GetValue("key3"));
}
示例2: Can_Deserialize_ProviderSettings_FromCamelCased_Json
public void Can_Deserialize_ProviderSettings_FromCamelCased_Json()
{
//// Arrange
var extendedData = new ExtendedDataCollection();
var settings = TestHelper.GetBraintreeProviderSettings();
extendedData.SaveProviderSettings(settings);
//// Act
var json = extendedData.GetValue(Constants.ExtendedDataKeys.BraintreeProviderSettings);
Assert.IsNotNullOrEmpty(json);
var deserialized = JsonConvert.DeserializeObject<BraintreeProviderSettings>(json);
Assert.NotNull(deserialized);
}
开发者ID:cmgrey83,项目名称:Merchello.Plugin.Payment.Braintree,代码行数:15,代码来源:BraintreeProviderSettingsTests.cs
示例3: Can_Deserialize_A_LineItemCollection_From_ExtendedDataCollection
public void Can_Deserialize_A_LineItemCollection_From_ExtendedDataCollection()
{
//// Arrange
var extendedData = new ExtendedDataCollection();
extendedData.AddLineItemCollection(_shipment.Items);
Console.Write(extendedData.GetValue(Constants.ExtendedDataKeys.LineItemCollection));
//// Act
var lineItemCollection = extendedData.GetLineItemCollection<ItemCacheLineItem>();
//// Assert
Assert.NotNull(lineItemCollection);
Assert.IsTrue(lineItemCollection.Any());
}
示例4: Can_Serialize_A_LineItemCollection_And_Store_In_ExtendedData
public void Can_Serialize_A_LineItemCollection_And_Store_In_ExtendedData()
{
//// Arrange
var extendedData = new ExtendedDataCollection();
//// Act
extendedData.AddLineItemCollection(_shipment.Items);
Console.Write(extendedData.GetValue(Constants.ExtendedDataKeys.LineItemCollection));
//// Assert
Assert.DoesNotThrow(() => XDocument.Parse(extendedData.GetValue(Constants.ExtendedDataKeys.LineItemCollection)));
}
示例5: Can_Serialize_An_Address_And_Store_In_ExtendedDataCollection
public void Can_Serialize_An_Address_And_Store_In_ExtendedDataCollection()
{
//// Arrange
var extendedData = new ExtendedDataCollection();
//// Act
extendedData.AddAddress(_address, AddressType.Billing);
Console.Write(extendedData.SerializeToXml());
//// Assert
Assert.DoesNotThrow(() => XDocument.Parse(extendedData.GetValue(Constants.ExtendedDataKeys.BillingAddress)));
}