|
|
|
@ -4,6 +4,8 @@ using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
|
|
|
|
|
namespace LinqStudy.Test.LinqToObject
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
@ -382,15 +384,12 @@ namespace LinqStudy.Test.LinqToObject
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Concat
|
|
|
|
|
///<summary>
|
|
|
|
|
/// 串联操作
|
|
|
|
|
///<summary>
|
|
|
|
|
public class ConcatTest
|
|
|
|
|
{
|
|
|
|
|
#region 串联操作:Concat
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
/// Concat:将两个序列合并成一个序列,不去重。与Union不同。
|
|
|
|
|
///<summary>
|
|
|
|
|
[Fact]
|
|
|
|
|
public void Concat_Test()
|
|
|
|
|
{
|
|
|
|
|
List<Person> peoples1 = new List<Person>()
|
|
|
|
@ -406,12 +405,10 @@ namespace LinqStudy.Test.LinqToObject
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var concatAct = peoples1.Concat(peoples2);
|
|
|
|
|
|
|
|
|
|
var totalCount = concatAct.Count();
|
|
|
|
|
|
|
|
|
|
Assert.Equal(4, totalCount);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|