-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQuickLinqTest.cs
More file actions
33 lines (28 loc) · 881 Bytes
/
QuickLinqTest.cs
File metadata and controls
33 lines (28 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;
namespace Konmaripo.Web.Tests.Unit
{
public class QuickLinqTest
{
[Fact]
public void LinqSequenceStuff()
{
var fullList = new List<int> { 1, 2, 3, 4, 5 };
var firstExcept = new List<int> { 1, 2};
var secondExcept = new List<int> { 5 };
var result = fullList.Except(firstExcept).Except(secondExcept);
result.Count().Should().Be(2);
result.Should().NotContain(1);
result.Should().NotContain(2);
result.Should().Contain(3);
result.Should().Contain(4);
result.Should().NotContain(5);
result.Should().BeEquivalentTo(new List<int>() { 4, 3 });
}
}
}