本文整理汇总了C#中Microsoft.VisualStudio.TestTools.UnitTesting.List.Replace方法的典型用法代码示例。如果您正苦于以下问题:C# List.Replace方法的具体用法?C# List.Replace怎么用?C# List.Replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudio.TestTools.UnitTesting.List
的用法示例。
在下文中一共展示了List.Replace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestReplaceAdd_NullDestination_Throws
public void TestReplaceAdd_NullDestination_Throws()
{
IReadOnlySublist<List<int>, int> list = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> destination = null;
int replacement = 0;
Func<int, bool> predicate = i => true;
list.Replace(predicate, replacement).AddTo(destination);
}
示例2: TestReplaceAdd_DestinationNull_Throws
public void TestReplaceAdd_DestinationNull_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = new List<int>() { 1 }.ToSublist();
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> destination = null;
source.Replace(sequence, replacement).AddTo(destination);
}
示例3: TestReplaceAdd_NullGenerator_Throws
public void TestReplaceAdd_NullGenerator_Throws()
{
IReadOnlySublist<List<int>, int> list = new List<int>().ToSublist();
Func<int, int> generator = null;
Func<int, bool> predicate = i => true;
list.Replace(predicate, generator);
}
示例4: TestReplaceAdd_WithGenerator_NullDestination_Throws
public void TestReplaceAdd_WithGenerator_NullDestination_Throws()
{
IReadOnlySublist<List<int>, int> list = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> destination = null;
Func<int, int> generator = i => i;
Func<int, bool> predicate = i => true;
list.Replace(predicate, generator).AddTo(destination);
}
示例5: TestReplaceAdd_WithComparison_SequenceNull_Throws
public void TestReplaceAdd_WithComparison_SequenceNull_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = null;
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
Func<int, int, bool> comparison = EqualityComparer<int>.Default.Equals;
source.Replace(sequence, replacement, comparison);
}
示例6: TestReplaceAdd_WithComparison_ComparerNull_Throws
public void TestReplaceAdd_WithComparison_ComparerNull_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = new List<int>() { 1 }.ToSublist();
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
Func<int, int, bool> comparison = null;
source.Replace(sequence, replacement, comparison);
}
示例7: TestReplaceAdd_WithComparer_SequenceEmpty_Throws
public void TestReplaceAdd_WithComparer_SequenceEmpty_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
IEqualityComparer<int> comparer = EqualityComparer<int>.Default;
source.Replace(sequence, replacement, comparer);
}
示例8: TestReplaceAdd_WithComparer_DestinationNull_Throws
public void TestReplaceAdd_WithComparer_DestinationNull_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = new List<int>() { 1 }.ToSublist();
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> destination = null;
IEqualityComparer<int> comparer = EqualityComparer<int>.Default;
source.Replace(sequence, replacement, comparer).AddTo(destination);
}
示例9: TestReplaceAdd_WithComparer_ComparerNull_Throws
public void TestReplaceAdd_WithComparer_ComparerNull_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = new List<int>() { 1 }.ToSublist();
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
IEqualityComparer<int> comparer = null;
source.Replace(sequence, replacement, comparer);
}
示例10: TestReplaceAdd_SequenceNull_Throws
public void TestReplaceAdd_SequenceNull_Throws()
{
IReadOnlySublist<List<int>, int> source = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = null;
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
source.Replace(sequence, replacement);
}
示例11: TestReplaceAdd_NullPredicate_Throws
public void TestReplaceAdd_NullPredicate_Throws()
{
IReadOnlySublist<List<int>, int> list = new List<int>().ToSublist();
int replacement = 0;
Func<int, bool> predicate = null;
list.Replace(predicate, replacement);
}
示例12: TestReplace_WithGenerator_NullPredicate_Throws
public void TestReplace_WithGenerator_NullPredicate_Throws()
{
IExpandableSublist<List<int>, int> list = new List<int>().ToSublist();
Func<int, int> generator = i => i;
Func<int, bool> predicate = null;
list.Replace(predicate, generator);
}
示例13: TestReplace_WithComparison_SequenceEmpty_Throws
public void TestReplace_WithComparison_SequenceEmpty_Throws()
{
IExpandableSublist<List<int>, int> list = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
Func<int, int, bool> comparison = EqualityComparer<int>.Default.Equals;
list.Replace(sequence, replacement, comparison);
}
示例14: TestReplace_WithComparer_SequenceNull_Throws
public void TestReplace_WithComparer_SequenceNull_Throws()
{
IExpandableSublist<List<int>, int> list = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = null;
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
IEqualityComparer<int> comparer = EqualityComparer<int>.Default;
list.Replace(sequence, replacement, comparer);
}
示例15: TestReplace_SequenceNull_Throws
public void TestReplace_SequenceNull_Throws()
{
IExpandableSublist<List<int>, int> list = new List<int>().ToSublist();
IExpandableSublist<List<int>, int> sequence = null;
IExpandableSublist<List<int>, int> replacement = new List<int>().ToSublist();
list.Replace(sequence, replacement);
}