mirror of
https://onedev.fprog.nl/AioNet
synced 2026-02-03 22:23:42 +01:00
Added unit tests for AioNet.Linq.
This commit is contained in:
parent
1b5effa51a
commit
08acbe0bf8
29
AioNet.LinqTest/AioNet.LinqTest.csproj
Normal file
29
AioNet.LinqTest/AioNet.LinqTest.csproj
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AioNet.Linq\AioNet.Linq.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
18
AioNet.LinqTest/ExtendedLinqTest.cs
Normal file
18
AioNet.LinqTest/ExtendedLinqTest.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
namespace AioNet.LinqTest;
|
||||
|
||||
using AioNet.Linq;
|
||||
|
||||
public class ExtendedLinqTest
|
||||
{
|
||||
[Fact]
|
||||
public void FindOneCombinationFor3Elements_SubsequenceLength3()
|
||||
{
|
||||
var foundCombinations = new[] { 1, 2, 3 }.Combinations(3);
|
||||
Assert.Single(foundCombinations);
|
||||
|
||||
var onlyCombination = foundCombinations.First();
|
||||
Assert.Contains(1, onlyCombination);
|
||||
Assert.Contains(2, onlyCombination);
|
||||
Assert.Contains(3, onlyCombination);
|
||||
}
|
||||
}
|
||||
1
AioNet.LinqTest/GlobalUsings.cs
Normal file
1
AioNet.LinqTest/GlobalUsings.cs
Normal file
|
|
@ -0,0 +1 @@
|
|||
global using Xunit;
|
||||
|
|
@ -5,6 +5,8 @@ VisualStudioVersion = 17.0.31903.59
|
|||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AioNet.Linq", "AioNet.Linq\AioNet.Linq.csproj", "{575A2A25-59BF-4ED1-8278-0BFCD24D65B1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AioNet.LinqTest", "AioNet.LinqTest\AioNet.LinqTest.csproj", "{30BEA554-220B-4A76-99AC-05E482EE18D9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -18,5 +20,9 @@ Global
|
|||
{575A2A25-59BF-4ED1-8278-0BFCD24D65B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{575A2A25-59BF-4ED1-8278-0BFCD24D65B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{575A2A25-59BF-4ED1-8278-0BFCD24D65B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{30BEA554-220B-4A76-99AC-05E482EE18D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{30BEA554-220B-4A76-99AC-05E482EE18D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{30BEA554-220B-4A76-99AC-05E482EE18D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{30BEA554-220B-4A76-99AC-05E482EE18D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
Loading…
Reference in a new issue