From 4fb527feadf920b8b0842dd5544761aed23e9e4e Mon Sep 17 00:00:00 2001 From: bicijinlian Date: Mon, 9 Sep 2019 17:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LinqStudy.Test/LinqToObject/SetsTest.cs | 27 +++++++++++-------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/LinqStudy.Test/LinqToObject/SetsTest.cs b/LinqStudy.Test/LinqToObject/SetsTest.cs index ced4bd1..4feb4fe 100644 --- a/LinqStudy.Test/LinqToObject/SetsTest.cs +++ b/LinqStudy.Test/LinqToObject/SetsTest.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Linq; using Xunit; +using System.Collections.Immutable; + namespace LinqStudy.Test.LinqToObject { /// @@ -382,35 +384,30 @@ namespace LinqStudy.Test.LinqToObject } #endregion - #region Concat + #region 串联操作:Concat + /// - /// 串联操作 + /// Concat:将两个序列合并成一个序列,不去重。与Union不同。 /// - public class ConcatTest + [Fact] + public void Concat_Test() { - /// - /// Concat:将两个序列合并成一个序列,不去重。与Union不同。 - /// - public void Concat_Test() - { - List peoples1 = new List() + List peoples1 = new List() { new Person(){ Id=2, Name="小龙女", Age=28}, new Person(){ Id=4, Name="杨过", Age=32}, }; - List peoples2 = new List() + List peoples2 = new List() { new Person(){ Id=2, Name="小龙女", Age=28}, new Person(){ Id=3, Name="云花公主", Age=16}, }; - var concatAct = peoples1.Concat(peoples2); + var concatAct = peoples1.Concat(peoples2); + var totalCount = concatAct.Count(); - var totalCount = concatAct.Count(); - - Assert.Equal(4, totalCount); - } + Assert.Equal(4, totalCount); } #endregion }