本文整理汇总了C#中ObservableCollectionEx.Should方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableCollectionEx.Should方法的具体用法?C# ObservableCollectionEx.Should怎么用?C# ObservableCollectionEx.Should使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableCollectionEx
的用法示例。
在下文中一共展示了ObservableCollectionEx.Should方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRangeAddsAllTheItems
public void AddRangeAddsAllTheItems()
{
var oc = new ObservableCollectionEx<string>();
var toAdd = new List<string>
{
"Foo",
"Bar"
};
oc.AddRange(toAdd);
oc.Should().ContainInOrder(toAdd);
oc.Should().OnlyContain(s => toAdd.Contains(s));
oc.Count.Should().Be(2);
}
示例2: UpdateToMatchRemovesMissingItems
public void UpdateToMatchRemovesMissingItems()
{
var oc = new ObservableCollectionEx<string>
{
"Existing",
"Items"
};
var toRemove = new List<string>
{
"Items"
};
oc.UpdateToMatch(toRemove, s => s);
oc.Should().ContainInOrder(toRemove);
oc.Should().OnlyContain(s => toRemove.Contains(s));
oc.Count.Should().Be(1);
}
示例3: UpdateToMatchAddsNewItems
public void UpdateToMatchAddsNewItems()
{
var oc = new ObservableCollectionEx<string>
{
"Existing",
"Items"
};
var toAdd = new List<string>
{
"Existing",
"Items",
"Foo",
"Bar"
};
oc.UpdateToMatch(toAdd, s => s);
oc.Should().ContainInOrder(toAdd);
oc.Should().OnlyContain(s => toAdd.Contains(s));
oc.Count.Should().Be(4);
}
示例4: ConstructorWithItemsSetsTheItems
public void ConstructorWithItemsSetsTheItems()
{
var toAdd = new List<string>
{
"Foo",
"Bar"
};
var oc = new ObservableCollectionEx<string>(toAdd);
oc.Should().ContainInOrder(toAdd);
oc.Should().OnlyContain(s => toAdd.Contains(s));
oc.Count.Should().Be(2);
}
示例5: ClearAndAddRangeClearsTheCollectionThenAddsAllTheItems
public void ClearAndAddRangeClearsTheCollectionThenAddsAllTheItems()
{
var oc = new ObservableCollectionEx<string>
{
"Existing",
"Items"
};
var toAdd = new List<string>
{
"Foo",
"Bar"
};
oc.ClearAndAddRange(toAdd);
oc.Should().ContainInOrder(toAdd);
oc.Should().OnlyContain(s => toAdd.Contains(s));
oc.Count.Should().Be(2);
}