-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from pfpack/release/v2.0.0-preview.2.0.0
release/v2.0.0-preview.2.0.0
- Loading branch information
Showing
88 changed files
with
1,991 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# PrimeFuncPack Primitives | ||
PrimeFuncPack Primitives is a core library for .NET consisting of useful extensions and predicates making work with functional pipelines, Linq, the nullable feature, etc. easier. | ||
PrimeFuncPack Primitives is a core library for .NET consisting of useful extensions and predicates making work with functional pipelines, Linq, strings, the nullable feature, etc. easier. |
26 changes: 26 additions & 0 deletions
26
src/primitives-linq/Primitives.Linq.Tests/Primitives.Linq.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<IsPackable>false</IsPackable> | ||
<Authors>Andrei Sergeev, Pavel Moskovoy</Authors> | ||
<Copyright>Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy</Copyright> | ||
<RootNamespace>PrimeFuncPack.Primitives.Tests</RootNamespace> | ||
<AssemblyName>PrimeFuncPack.Primitives.Linq.Tests</AssemblyName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnit" Version="3.13.2" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | ||
<PackageReference Include="PrimeFuncPack.UnitTest.Data" Version="2.0.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Primitives.Linq\Primitives.Linq.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
21 changes: 21 additions & 0 deletions
21
src/primitives-linq/Primitives.Linq.Tests/TestData/ObjectTestData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#nullable enable | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using static PrimeFuncPack.UnitTest.TestData; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
internal static class ObjectTestData | ||
{ | ||
public static IEnumerable<object?[]> NullableObjectTestSource | ||
=> | ||
new object?[] | ||
{ | ||
null, | ||
PlusFifteenIdRefType, | ||
SomeTextStructType | ||
} | ||
.Select(v => new object?[] { v }); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#nullable enable | ||
|
||
using NUnit.Framework; | ||
using System.Linq; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
partial class YieldExtensionsTest | ||
{ | ||
[Test] | ||
[TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] | ||
public void YieldSingle_ExpectCollectionLengthEqualsOne( | ||
object? sourceValue) | ||
{ | ||
var actual = sourceValue.YieldSingle(); | ||
|
||
var actualLength = actual.Count(); | ||
Assert.AreEqual(1, actualLength); | ||
} | ||
|
||
[Test] | ||
[TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] | ||
public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( | ||
object? sourceValue) | ||
{ | ||
var actual = sourceValue.YieldSingle(); | ||
|
||
var actualFirst = actual.FirstOrDefault(); | ||
Assert.AreSame(sourceValue, actualFirst); | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#nullable enable | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
public sealed partial class YieldExtensionsTest | ||
{ | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#nullable enable | ||
|
||
using NUnit.Framework; | ||
using PrimeFuncPack.UnitTest; | ||
using System.Linq; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
partial class YielderTest | ||
{ | ||
[Test] | ||
public void YieldEmpty_ExpectEmptyCollection() | ||
{ | ||
var actual = Yielder.YieldEmpty<StructType?>(); | ||
Assert.IsEmpty(actual); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#nullable enable | ||
|
||
using NUnit.Framework; | ||
using System.Linq; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
partial class YielderTest | ||
{ | ||
[Test] | ||
[TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] | ||
public void YieldSingle_ExpectCollectionLengthEqualsOne( | ||
object? sourceValue) | ||
{ | ||
var actual = Yielder.YieldSingle(sourceValue); | ||
|
||
var actualLength = actual.Count(); | ||
Assert.AreEqual(1, actualLength); | ||
} | ||
|
||
[Test] | ||
[TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] | ||
public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( | ||
object? sourceValue) | ||
{ | ||
var actual = Yielder.YieldSingle(sourceValue); | ||
|
||
var actualFirst = actual.FirstOrDefault(); | ||
Assert.AreSame(sourceValue, actualFirst); | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#nullable enable | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
public sealed partial class YielderTest | ||
{ | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#nullable enable | ||
|
||
using NUnit.Framework; | ||
using PrimeFuncPack.UnitTest; | ||
using System.Linq; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
partial class YielderTypedTest | ||
{ | ||
[Test] | ||
public void YieldEmpty_ExpectEmptyCollection() | ||
{ | ||
var actual = Yielder<StructType?>.YieldEmpty(); | ||
Assert.IsEmpty(actual); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#nullable enable | ||
|
||
using NUnit.Framework; | ||
using System.Linq; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
partial class YielderTypedTest | ||
{ | ||
[Test] | ||
[TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] | ||
public void YieldSingle_ExpectCollectionLengthEqualsOne( | ||
object? sourceValue) | ||
{ | ||
var actual = Yielder<object?>.YieldSingle(sourceValue); | ||
|
||
var actualLength = actual.Count(); | ||
Assert.AreEqual(1, actualLength); | ||
} | ||
|
||
[Test] | ||
[TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] | ||
public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( | ||
object? sourceValue) | ||
{ | ||
var actual = Yielder<object?>.YieldSingle(sourceValue); | ||
|
||
var actualFirst = actual.FirstOrDefault(); | ||
Assert.AreSame(sourceValue, actualFirst); | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#nullable enable | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
public sealed partial class YielderTypedTest | ||
{ | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<Authors>Andrei Sergeev, Pavel Moskovoy</Authors> | ||
<Copyright>Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy</Copyright> | ||
<Description>PrimeFuncPack Primitives.Linq is a core library for .NET consisting of useful extensions making work with Linq easier.</Description> | ||
<RootNamespace>System</RootNamespace> | ||
<AssemblyName>PrimeFuncPack.Primitives.Linq</AssemblyName> | ||
<Version>2.0.0-preview.2.0.0</Version> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath></PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#nullable enable | ||
|
||
using NUnit.Framework; | ||
using System; | ||
|
||
namespace PrimeFuncPack.Primitives.Tests | ||
{ | ||
partial class PipelineTests | ||
{ | ||
[Test] | ||
[TestCaseSource(nameof(ValueTestSource))] | ||
public void Pipe_ExpectSourceValue( | ||
object? sourceValue) | ||
{ | ||
var actual = Pipeline.Pipe(sourceValue); | ||
Assert.AreSame(sourceValue, actual); | ||
} | ||
} | ||
} |
Oops, something went wrong.