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


C# List.DeepEquals方法代码示例

本文整理汇总了C#中Microsoft.VisualStudio.TestTools.UnitTesting.List.DeepEquals方法的典型用法代码示例。如果您正苦于以下问题:C# List.DeepEquals方法的具体用法?C# List.DeepEquals怎么用?C# List.DeepEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.VisualStudio.TestTools.UnitTesting.List的用法示例。


在下文中一共展示了List.DeepEquals方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeepEquals_WithComparerListsWithVaryingNumberOfDuplicatedValues_ReturnsFalse

 public void DeepEquals_WithComparerListsWithVaryingNumberOfDuplicatedValues_ReturnsFalse()
 {
     List<string> listA = new List<string> {"a", "b", "d", "d", "e"};
     List<string> listB = new List<string> {"a", "b", "b", "d", "e"};
     Assert.IsFalse(
         listA.DeepEquals(listB, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be false for lists containing the same values, but with different amounts of each duplicated.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例2: DeepEquals_WithComparerListsOfDifferentSize_ReturnsFalse

 public void DeepEquals_WithComparerListsOfDifferentSize_ReturnsFalse()
 {
     List<string> listA = new List<string> {"a", "b", "c", "d", "e"};
     List<string> listB = new List<string> {"a", "b", "c", "d", "e", "f"};
     Assert.IsFalse(
         listA.DeepEquals(listB, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be false for lists of different length.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例3: DeepEquals_WithComparerListsOfSameSizeButOneDifferentValue_ReturnsFalse

 public void DeepEquals_WithComparerListsOfSameSizeButOneDifferentValue_ReturnsFalse()
 {
     List<string> listA = new List<string> {"a", "b", "c", "d", "e"};
     List<string> listB = new List<string> {"a", "b", "c", "z", "e"};
     Assert.IsFalse(
         listA.DeepEquals(listB, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be false for lists of identical length but with different values.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例4: DeepEquals_WithComparerEquivilantListsWithDuplicatedValues_ReturnsTrue

 public void DeepEquals_WithComparerEquivilantListsWithDuplicatedValues_ReturnsTrue()
 {
     List<string> listA = new List<string> {"a", "b", "B", "d", "e"};
     List<string> listB = new List<string> {"a", "B", "d", "B", "e"};
     Assert.IsTrue(
         listA.DeepEquals(listB, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be true for lists whose contents contains duplicates, but the same number of each .");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例5: DeepEquals_WithComparerEquivilantLists_ReturnsTrue

 public void DeepEquals_WithComparerEquivilantLists_ReturnsTrue()
 {
     List<string> list1 = new List<string> {"a", "b", "C", "D", "e"};
     List<string> list2 = new List<string> {"a", "B", "c", "d", "e"};
     Assert.IsTrue(
         list1.DeepEquals(list2, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be true for list where all items are deemed equivilant by the comparer supplied.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例6: DeepEquals_WithComparerOneNull_ReturnsFalse

 public void DeepEquals_WithComparerOneNull_ReturnsFalse()
 {
     List<string> list = new List<string> {"a", "b", "c", "d", "e"};
     Assert.IsFalse(
         list.DeepEquals(null, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be false if only one list is null.");
     Assert.IsFalse(
         ((List<string>) null).DeepEquals(list, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be false if only one list is null.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:10,代码来源:MiscellaneousExtensionsTests.cs

示例7: DeepEquals_ListsOfDifferentSize_ReturnsFalse

 public void DeepEquals_ListsOfDifferentSize_ReturnsFalse()
 {
     List<int> listA = new List<int> {1, 2, 3, 4, 5, 6};
     List<int> listB = new List<int> {1, 2, 3, 5, 6};
     Assert.IsFalse(listA.DeepEquals(listB), "DeepEquals should be false for lists of different length.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:6,代码来源:MiscellaneousExtensionsTests.cs

示例8: DeepEquals_WithComparerIdenticalLists_ReturnsTrue

 public void DeepEquals_WithComparerIdenticalLists_ReturnsTrue()
 {
     List<string> list = new List<string> {"a", "b", "c", "d", "e"};
     Assert.IsTrue(
         list.DeepEquals(list, StringComparer.OrdinalIgnoreCase),
         "DeepEquals should be true for identical lists.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:7,代码来源:MiscellaneousExtensionsTests.cs

示例9: DeepEquals_ListsWithVaryingNumberOfDuplicatedValues_ReturnsFalse

 public void DeepEquals_ListsWithVaryingNumberOfDuplicatedValues_ReturnsFalse()
 {
     List<int> listA = new List<int> {1, 2, 3, 3, 5, 6};
     List<int> listB = new List<int> {1, 2, 3, 5, 5, 6};
     Assert.IsFalse(
         listA.DeepEquals(listB),
         "DeepEquals should be false for lists containing the same values, but with different amounts of each duplicated.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例10: DeepEquals_EquivilantListsWithDuplicatedValues_ReturnsTrue

 public void DeepEquals_EquivilantListsWithDuplicatedValues_ReturnsTrue()
 {
     List<int> listA = new List<int> {1, 2, 3, 4, 3, 6};
     List<int> listB = new List<int> {1, 4, 3, 3, 2, 6};
     Assert.IsTrue(
         listA.DeepEquals(listB),
         "DeepEquals should be true for lists whose contents contains duplicates, but the same number of each .");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例11: DeepEquals_ListsOfSameSizeButOneDifferentValue_ReturnsFalse

 public void DeepEquals_ListsOfSameSizeButOneDifferentValue_ReturnsFalse()
 {
     List<int> listA = new List<int> {1, 2, 3, 4, 5, 6};
     List<int> listB = new List<int> {1, 2, 3, 99, 5, 6};
     Assert.IsFalse(
         listA.DeepEquals(listB),
         "DeepEquals should be false for lists of identical length but with different values.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:8,代码来源:MiscellaneousExtensionsTests.cs

示例12: DeepEquals_OneNull_ReturnsFalse

 public void DeepEquals_OneNull_ReturnsFalse()
 {
     List<int> list = new List<int> {1, 2, 3, 4, 5, 6};
     Assert.IsFalse(list.DeepEquals(null), "DeepEquals should be false if only one list is null.");
     Assert.IsFalse(((List<int>) null).DeepEquals(list), "DeepEquals should be false if only one list is null.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:6,代码来源:MiscellaneousExtensionsTests.cs

示例13: DeepEquals_IdenticalLists_ReturnsTrue

 public void DeepEquals_IdenticalLists_ReturnsTrue()
 {
     List<int> list = new List<int> {1, 2, 3, 4, 5, 6};
     Assert.IsTrue(list.DeepEquals(list), "DeepEquals should be true for identical lists.");
 }
开发者ID:webappsuk,项目名称:CoreLibraries,代码行数:5,代码来源:MiscellaneousExtensionsTests.cs


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