本文整理汇总了C#中Wrapper.ReplaceWith方法的典型用法代码示例。如果您正苦于以下问题:C# Wrapper.ReplaceWith方法的具体用法?C# Wrapper.ReplaceWith怎么用?C# Wrapper.ReplaceWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wrapper
的用法示例。
在下文中一共展示了Wrapper.ReplaceWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: replacing_a_node_should_set_the_new_nodes_predecessor_and_successor
public void replacing_a_node_should_set_the_new_nodes_predecessor_and_successor()
{
var node1 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var node2 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var node3 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var newNode = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
node1.AddToEnd(node2);
node1.AddToEnd(node3);
node2.ReplaceWith(newNode);
newNode.Previous.ShouldBeTheSameAs(node1);
newNode.Next.ShouldBeTheSameAs(node3);
node1.Next.ShouldBeTheSameAs(newNode);
node3.Previous.ShouldBeTheSameAs(newNode);
}
示例2: replacing_a_node_without_a_predecessor_should_set_the_new_node_to_the_front
public void replacing_a_node_without_a_predecessor_should_set_the_new_node_to_the_front()
{
var node1 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var node2 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var newNode = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
node1.AddToEnd(node2);
node1.ReplaceWith(newNode);
newNode.Previous.ShouldBeNull();
newNode.Next.ShouldBeTheSameAs(node2);
}
示例3: replacing_a_node_should_disconnect_the_node_being_replaced
public void replacing_a_node_should_disconnect_the_node_being_replaced()
{
var node1 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var node2 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var node3 = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
var newNode = new Wrapper(typeof (ObjectDefInstanceTester.FakeJsonBehavior));
node1.AddToEnd(node2);
node1.AddToEnd(node3);
node2.ReplaceWith(newNode);
node2.Next.ShouldBeNull();
node2.Previous.ShouldBeNull();
}