当前位置: 首页>>代码示例>>C#>>正文


C# List.Replace方法代码示例

本文整理汇总了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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:7,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:9,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:7,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:7,代码来源:ReplaceAddTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:7,代码来源:ReplaceInPlaceTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceInPlaceTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:8,代码来源:ReplaceInPlaceTester.cs

示例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);
 }
开发者ID:jehugaleahsa,项目名称:NDex,代码行数:7,代码来源:ReplaceInPlaceTester.cs


注:本文中的Microsoft.VisualStudio.TestTools.UnitTesting.List.Replace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。