本文整理汇总了C#中DynamicDictionary.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicDictionary.Remove方法的具体用法?C# DynamicDictionary.Remove怎么用?C# DynamicDictionary.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicDictionary
的用法示例。
在下文中一共展示了DynamicDictionary.Remove方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_return_true_when_string_overload_of_remove_method_can_match_key
public void Should_return_true_when_string_overload_of_remove_method_can_match_key()
{
var input = new DynamicDictionary();
input["test"] = 10;
// When
var result = input.Remove("test");
// Then
result.ShouldBeTrue();
}
示例2: Should_remove_natural_key
public void Should_remove_natural_key()
{
// Given
var input = new DynamicDictionary();
input.Add("a-b-c", "hello");
//when
input.Remove("a-b-c");
//then
input.ContainsKey("abc").ShouldBeFalse();
}
示例3: Should_return_true_when_keyvaluepair_overload_of_remove_method_can_match_key
public void Should_return_true_when_keyvaluepair_overload_of_remove_method_can_match_key()
{
var input = new DynamicDictionary();
input["test"] = 10;
// When
var result = input.Remove(new KeyValuePair<string, dynamic>("test", 10));
// Then
result.ShouldBeTrue();
}
示例4: Should_remove_item_when_string_overload_of_remove_method_is_invoked
public void Should_remove_item_when_string_overload_of_remove_method_is_invoked()
{
// Given
var input = new DynamicDictionary();
input["test"] = 10;
// When
input.Remove("test");
// Then
input.ContainsKey("test").ShouldBeFalse();
}
示例5: Should_remove_item_when_keyvaluepair_overload_of_remove_method_is_invoked
public void Should_remove_item_when_keyvaluepair_overload_of_remove_method_is_invoked()
{
// Given
var input = new DynamicDictionary();
input["test"] = 10;
// When
input.Remove(new KeyValuePair<string, dynamic>("test", 10));
// Then
input.ContainsKey("test").ShouldBeFalse();
}
示例6: TestRemoveKeyValuePair
public void TestRemoveKeyValuePair()
{
var d = new DynamicDictionary();
d.Add("key", "value");
Assert.IsTrue(d.Remove(new KeyValuePair<string, object>("key", "value")));
Assert.AreEqual(0, d.Count);
}
示例7: TestCount
public void TestCount()
{
var d = new DynamicDictionary();
Assert.AreEqual(0, d.Count);
d.Add("key", "value");
Assert.AreEqual(1, d.Count);
d.Remove("key");
Assert.AreEqual(0, d.Count);
}
示例8: TestRemove
public void TestRemove()
{
var d = new DynamicDictionary();
d.Add("key", "value");
Assert.IsTrue(d.Remove("key"), "Did not remove key: \"key\"");
}