diff --git a/LinqStudy.Test/LinqStudy.Test.csproj b/LinqStudy.Test/LinqStudy.Test.csproj index eb3dddd..0e3da8f 100644 --- a/LinqStudy.Test/LinqStudy.Test.csproj +++ b/LinqStudy.Test/LinqStudy.Test.csproj @@ -18,7 +18,6 @@ - diff --git a/LinqStudy.Test/LinqToObject/LinqTest.cs b/LinqStudy.Test/LinqToObject/LinqTest.cs deleted file mode 100644 index b955451..0000000 --- a/LinqStudy.Test/LinqToObject/LinqTest.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; -using System.Linq.Expressions; -using FluentAssertions; - -using Xunit; - -namespace LinqStudy.Test.LinqToObject -{ - /// - /// 基本项测试 - /// 异常、空值等项 - /// - public class LinqTest - { - [Fact] - public void Null_Test() - { - List person = null; - - //对Linq操作符而言,基本上数据源为Null时,将引发异常。 - Assert.ThrowsAny(() => - { - var query = person.Where(p => p == null); - }); - } - - [Fact] - public void Count_0_Test() - { - List person = new List(); - - //数据源为没有任何内容项时,即 Count=0,不会引发异常。 - Action action = () => - { - //查不到任何数据,不返回null,而是返回 Count=0的对象。 - person.Where(p => p == null).ToList(); - }; - - action.Should().NotThrow(); - } - } -} diff --git a/LinqStudy.Test/LinqToObject/SelectTest.cs b/LinqStudy.Test/LinqToObject/SelectTest.cs deleted file mode 100644 index 21331d7..0000000 --- a/LinqStudy.Test/LinqToObject/SelectTest.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using Xunit; - -using LinqStudy; - -namespace LinqStudy.Test.LinqToObject -{ - /// - /// Select 测试 - /// - public class SelectTest - { - [Fact] - public void TestName() - { - // Arrange - var persons = PersonManager.GetPersons(); - // Act - var maps=persons.Select(p=>p.Age).ToList(); - - // Assert - Assert.IsType>(maps); - } - } -} diff --git a/LinqStudy.sln b/LinqStudy.sln index 81519e0..78602ff 100644 --- a/LinqStudy.sln +++ b/LinqStudy.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29215.179 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqStudy", "LinqStudy\LinqStudy.csproj", "{5867719F-953F-4216-B245-4937B9DCF997}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinqStudy", "LinqStudy\LinqStudy.csproj", "{5867719F-953F-4216-B245-4937B9DCF997}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinqStudy.Test", "LinqStudy.Test\LinqStudy.Test.csproj", "{8DC599B0-ADE6-4DBA-9CDC-3094A6DCCBFA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinqStudy.Test", "LinqStudy.Test\LinqStudy.Test.csproj", "{8DC599B0-ADE6-4DBA-9CDC-3094A6DCCBFA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution