diff --git a/src/core-func-factory/Fanc.Factory.Tests/Fanc.Factory.Tests.csproj b/src/core-func-factory/Fanc.Factory.Tests/Fanc.Factory.Tests.csproj new file mode 100644 index 00000000..25307fc6 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Fanc.Factory.Tests.csproj @@ -0,0 +1,29 @@ + + + + net5.0 + true + false + Andrei Sergeev, Pavel Moskovoy + PrimeFuncPack: A Functional Programming Pack for .NET + Copyright © 2020 Andrei Sergeev, Pavel Moskovoy + PrimeFuncPack.Core.Tests + PrimeFuncPack.Core.Func.Factory.Tests + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.00.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.00.cs new file mode 100644 index 00000000..943352d2 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.00.cs @@ -0,0 +1,42 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_00_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(null, false)] + [InlineData(null, true)] + [InlineData(EmptyString, false)] + [InlineData(EmptyString, true)] + [InlineData(WhiteSpaceString, false)] + [InlineData(WhiteSpaceString, true)] + [InlineData(SomeString, false)] + [InlineData(SomeString, true)] + public async Task Create_00_ThenInvokeAsync_ExpectResultOfSourceFunc( + string? sourceFuncResult, bool canceled) + { + var actual = Func.Create(_ => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: canceled); + var actualResult = await actual.InvokeAsync(cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.01.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.01.cs new file mode 100644 index 00000000..be6afc85 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.01.cs @@ -0,0 +1,35 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_01_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_01_ThenInvokeAsync_ExpectResultOfSourceFunc( + RecordType? sourceFuncResult) + { + var actual = Func.Create((_, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = default(CancellationToken); + var actualResult = await actual.InvokeAsync(PlusFifteenIdRefType, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.02.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.02.cs new file mode 100644 index 00000000..aff1393e --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.02.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_02_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(null)] + [InlineData(true)] + [InlineData(false)] + public async Task Create_02_ThenInvokeAsync_ExpectResultOfSourceFunc( + bool? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: true); + var actualResult = await actual.InvokeAsync(MinusFifteenIdNullNameRecord, default, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.03.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.03.cs new file mode 100644 index 00000000..59bdaa2b --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.03.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_03_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_03_ThenInvokeAsync_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: false); + + var actualResult = await actual.InvokeAsync( + LowerSomeString, ZeroIdRefType, PlusFifteenIdLowerSomeStringNameRecord, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.04.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.04.cs new file mode 100644 index 00000000..95fba73d --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.04.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_04_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_04_ThenInvokeAsync_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: true); + + var actualResult = await actual.InvokeAsync( + new object(), MinusFifteen, PlusFifteenIdLowerSomeStringNameRecord, default, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.05.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.05.cs new file mode 100644 index 00000000..e10b57a4 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.05.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_05_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_05_ThenInvokeAsync_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: false); + + var actualResult = await actual.InvokeAsync( + MinusFifteen, PlusFifteenIdSomeStringNameRecord, null, SomeString, new(), cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.06.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.06.cs new file mode 100644 index 00000000..0d3f0b71 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.06.cs @@ -0,0 +1,43 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_06_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(null)] + [InlineData(EmptyString)] + [InlineData(WhiteSpaceString)] + [InlineData(TabString)] + [InlineData(LowerSomeString)] + [InlineData(SomeString)] + public async Task Create_06_ThenInvokeAsync_ExpectResultOfSourceFunc( + string? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(); + + var actualResult = await actual.InvokeAsync( + MinusFifteenIdRefType, null!, new(), new(), PlusFifteenIdLowerSomeStringNameRecord, int.MaxValue, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.07.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.07.cs new file mode 100644 index 00000000..31bacd2d --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.07.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_07_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_07_ThenInvokeAsync_ExpectResultOfSourceFunc( + RecordType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: true); + + var actualResult = await actual.InvokeAsync( + SomeString, PlusFifteen, MinusFifteenIdRefType, SomeTextStructType, null!, EmptyString, LowerSomeTextStructType, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.08.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.08.cs new file mode 100644 index 00000000..4249dd6d --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.08.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_08_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_08_ThenInvokeAsync_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: false); + + var actualResult = await actual.InvokeAsync( + new { Id = PlusFifteen }, default, DateTimeKind.Local, PlusFifteenIdLowerSomeStringNameRecord, MinusFifteen, null!, SomeTextStructType, MinusFifteenIdSomeStringNameRecord, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.09.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.09.cs new file mode 100644 index 00000000..68d2820b --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.09.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_09_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_09_ThenInvokeAsync_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: false); + + var actualResult = await actual.InvokeAsync( + ZeroIdNullNameRecord, MinusFifteenIdRefType, MinusFifteen, new(), default, SomeString, null, WhiteSpaceString, MinusFifteenIdRefType, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.10.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.10.cs new file mode 100644 index 00000000..67a28643 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.10.cs @@ -0,0 +1,42 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_10_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(null)] + [InlineData(Zero)] + [InlineData(MinusFifteen)] + [InlineData(PlusFifteen)] + [InlineData(int.MaxValue)] + public async Task Create_10_ThenInvokeAsync_ExpectResultOfSourceFunc( + int? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = default(CancellationToken); + + var actualResult = await actual.InvokeAsync( + null, SomeTextStructType, PlusFifteenIdRefType, MinusFifteenIdSomeStringNameRecord, MinusFifteen, TabString, long.MinValue, Zero, MinusFifteenIdRefType, LowerSomeTextStructType, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.11.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.11.cs new file mode 100644 index 00000000..8b6ff32c --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.11.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_11_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_11_ThenInvokeAsync_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: true); + + var actualResult = await actual.InvokeAsync( + LowerSomeTextStructType, default, long.MaxValue, UpperSomeString, PlusFifteenIdRefType, null!, long.MinValue, DateTimeKind.Utc, null!, MinusFifteenIdRefType, SomeTextStructType, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.12.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.12.cs new file mode 100644 index 00000000..3d575fba --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.12.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_12_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_12_ThenInvokeAsync_ExpectResultOfSourceFunc( + RecordType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: true); + + var actualResult = await actual.InvokeAsync( + PlusFifteen, new { Name = UpperSomeString }, null, PlusFifteenIdRefType, null!, SomeString, EmptyString, decimal.MinusOne, byte.MaxValue, MinusFifteenIdSomeStringNameRecord, LowerSomeTextStructType, SomeTextStructType, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.13.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.13.cs new file mode 100644 index 00000000..457eadee --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.13.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_13_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_13_ThenInvokeAsync_ExpectResultOfSourceFunc( + RefType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: false); + + var actualResult = await actual.InvokeAsync( + decimal.One, SomeTextStructType, PlusFifteenIdRefType, ZeroIdNullNameRecord, default, default, MinusFifteenIdRefType, DateTimeKind.Unspecified, null!, new(), ThreeWhiteSpacesString, MinusFifteenIdNullNameRecord, EmptyString, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.14.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.14.cs new file mode 100644 index 00000000..59d8c307 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.14.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_14_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_14_ThenInvokeAsync_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: false); + + var actualResult = await actual.InvokeAsync( + PlusFifteen, MinusFifteenIdRefType, new(), decimal.MinusOne, MinusFifteenIdSomeStringNameRecord, SomeTextStructType, long.MinValue, PlusFifteenIdRefType, int.MaxValue, DateTimeKind.Utc, null!, long.MinValue, MinusFifteenIdRefType, int.MinValue, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.15.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.15.cs new file mode 100644 index 00000000..3e6a68c5 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.15.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using System.Threading; +using System.Threading.Tasks; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class AsyncFuncTest + { + [Fact] + public void Create_15_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func>)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public async Task Create_15_ThenInvokeAsync_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => ValueTask.FromResult(sourceFuncResult)); + + var cancellationToken = new CancellationToken(canceled: true); + + var actualResult = await actual.InvokeAsync( + LowerSomeTextStructType, SomeString, long.MaxValue, null, MinusFifteen, PlusFifteenIdRefType, PlusFifteenIdLowerSomeStringNameRecord, decimal.One, ThreeWhiteSpacesString, byte.MaxValue, new { Name = SomeString }, ZeroIdRefType, new(), decimal.MaxValue, null, cancellationToken); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.cs new file mode 100644 index 00000000..df8dbeec --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.AsyncFunc/AsyncFuncTest.cs @@ -0,0 +1,8 @@ +#nullable enable + +namespace PrimeFuncPack.Core.Tests +{ + public sealed partial class AsyncFuncTest + { + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.00.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.00.cs new file mode 100644 index 00000000..db3b7e0c --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.00.cs @@ -0,0 +1,32 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_00_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public void Create_00_ThenInvoke_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + () => sourceFuncResult); + + var actualResult = actual.Invoke(); + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.01.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.01.cs new file mode 100644 index 00000000..5d809d78 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.01.cs @@ -0,0 +1,31 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_01_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public void Create_01_ThenInvoke_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + _ => sourceFuncResult); + + var actualResult = actual.Invoke(new()); + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.02.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.02.cs new file mode 100644 index 00000000..c6e04a10 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.02.cs @@ -0,0 +1,32 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_02_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public void Create_02_ThenInvoke_ExpectResultOfSourceFunc( + RecordType sourceFuncResult) + { + var actual = Func.Create( + (_, _) => sourceFuncResult); + + var actualResult = actual.Invoke(long.MaxValue, PlusFifteenIdRefType); + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.03.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.03.cs new file mode 100644 index 00000000..11361bba --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.03.cs @@ -0,0 +1,36 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_03_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(null)] + [InlineData(true)] + [InlineData(false)] + public void Create_03_ThenInvoke_ExpectResultOfSourceFunc( + bool? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + SomeTextStructType, default!, MinusFifteenIdSomeStringNameRecord); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.04.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.04.cs new file mode 100644 index 00000000..c6c1083b --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.04.cs @@ -0,0 +1,39 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_04_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(null)] + [InlineData(EmptyString)] + [InlineData(WhiteSpaceString)] + [InlineData(TabString)] + [InlineData(LowerSomeString)] + [InlineData(SomeString)] + public void Create_04_ThenInvoke_ExpectResultOfSourceFunc( + string sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + null, MinusFifteenIdRefType, LowerSomeTextStructType, ZeroIdNullNameRecord); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.05.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.05.cs new file mode 100644 index 00000000..a2d88781 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.05.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_05_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public void Create_05_ThenInvoke_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + SomeTextStructType, new(), null, MinusFifteenIdNullNameRecord, default); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.06.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.06.cs new file mode 100644 index 00000000..18d8f165 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.06.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_06_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public void Create_06_ThenInvoke_ExpectResultOfSourceFunc( + RecordType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + new(), TabString, PlusFifteenIdLowerSomeStringNameRecord, int.MaxValue, SomeTextStructType, null!); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.07.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.07.cs new file mode 100644 index 00000000..69ca17a7 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.07.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_07_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public void Create_07_ThenInvoke_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + new { Name = LowerSomeString }, UpperSomeString, null, MinusFifteenIdRefType, PlusFifteen, PlusFifteenIdRefType, long.MaxValue); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.08.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.08.cs new file mode 100644 index 00000000..fd74c4db --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.08.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_08_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public void Create_08_ThenInvoke_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + SomeTextStructType, PlusFifteenIdLowerSomeStringNameRecord, new(), MinusFifteen, SomeString, PlusFifteenIdRefType, null, EmptyString); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.09.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.09.cs new file mode 100644 index 00000000..d6496386 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.09.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_09_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public void Create_09_ThenInvoke_ExpectResultOfSourceFunc( + RecordType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + PlusFifteen, default, MinusFifteenIdRefType, long.MinValue, decimal.One, ZeroIdRefType, PlusFifteenIdLowerSomeStringNameRecord, int.MinValue, TabString); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.10.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.10.cs new file mode 100644 index 00000000..c74edefd --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.10.cs @@ -0,0 +1,38 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_10_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [InlineData(int.MinValue)] + [InlineData(MinusFifteen)] + [InlineData(Zero)] + [InlineData(PlusFifteen)] + [InlineData(int.MaxValue)] + public void Create_10_ThenInvoke_ExpectResultOfSourceFunc( + int sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + null, default, LowerSomeString, PlusFifteenIdRefType, SomeTextStructType, new(), null, null!, byte.MaxValue, DateTimeKind.Unspecified); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.11.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.11.cs new file mode 100644 index 00000000..ed75e507 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.11.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_11_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public void Create_11_ThenInvoke_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + MinusFifteenIdSomeStringNameRecord, UpperSomeString, null!, DateTimeKind.Utc, MinusFifteenIdNullNameRecord, PlusFifteenIdRefType, SomeTextStructType, ZeroIdRefType, Zero, new(), LowerSomeTextStructType); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.12.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.12.cs new file mode 100644 index 00000000..676f9bfe --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.12.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_12_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public void Create_12_ThenInvoke_ExpectResultOfSourceFunc( + RecordType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + MinusFifteenIdSomeStringNameRecord, MinusFifteenIdRefType, int.MaxValue, null, LowerSomeTextStructType, PlusFifteenIdRefType, ZeroIdNullNameRecord, default, default, PlusFifteenIdRefType, long.MaxValue, PlusFifteen); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.13.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.13.cs new file mode 100644 index 00000000..b778fcf6 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.13.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_13_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public void Create_13_ThenInvoke_ExpectResultOfSourceFunc( + RefType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + ZeroIdNullNameRecord, MinusFifteen, LowerSomeTextStructType, null!, null!, decimal.MinusOne, long.MaxValue, MinusFifteenIdNullNameRecord, EmptyString, long.MinValue, default, long.MinValue, PlusFifteenIdRefType); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.14.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.14.cs new file mode 100644 index 00000000..e551f22d --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.14.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_14_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RecordTypes), MemberType = typeof(TestEntitySource))] + public void Create_14_ThenInvoke_ExpectResultOfSourceFunc( + RecordType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + LowerSomeString, PlusFifteen, SomeTextStructType, default, decimal.MinusOne, MinusFifteenIdNullNameRecord, PlusFifteenIdRefType, SomeString, NullTextStructType, PlusFifteenIdRefType, ZeroIdRefType, MinusFifteen, EmptyString, decimal.One); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.15.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.15.cs new file mode 100644 index 00000000..6b978eed --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.15.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_15_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.StructTypes), MemberType = typeof(TestEntitySource))] + public void Create_15_ThenInvoke_ExpectResultOfSourceFunc( + StructType sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + decimal.MinusOne, new(), null, decimal.MaxValue, PlusFifteenIdLowerSomeStringNameRecord, new { Sum = PlusFifteen }, long.MaxValue, MinusFifteen, MinusFifteenIdSomeStringNameRecord, SomeString, long.MinValue, null, null, WhiteSpaceString, SomeTextStructType); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.16.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.16.cs new file mode 100644 index 00000000..014ddc74 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.16.cs @@ -0,0 +1,34 @@ +#nullable enable + +using System; +using PrimeFuncPack.UnitTest; +using Xunit; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + partial class FuncTest + { + [Fact] + public void Create_16_SourceFuncIsNull_ExpectArgumentNullException() + { + var sourceFunc = (Func)null!; + var ex = Assert.Throws(() => _ = Func.Create(sourceFunc)); + Assert.Equal("func", ex.ParamName); + } + + [Theory] + [MemberData(nameof(TestEntitySource.RefTypes), MemberType = typeof(TestEntitySource))] + public void Create_16_ThenInvoke_ExpectResultOfSourceFunc( + RefType? sourceFuncResult) + { + var actual = Func.Create( + (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => sourceFuncResult); + + var actualResult = actual.Invoke( + PlusFifteen, default, EmptyString, null, SomeString, MinusFifteenIdRefType, SomeTextStructType, new(), int.MaxValue, decimal.MinusOne, LowerSomeString, long.MinValue, null, MinusFifteenIdNullNameRecord, byte.MaxValue, null); + + Assert.Equal(sourceFuncResult, actualResult); + } + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.cs b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.cs new file mode 100644 index 00000000..64c725a6 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/Test.Func/FuncTest.cs @@ -0,0 +1,8 @@ +#nullable enable + +namespace PrimeFuncPack.Core.Tests +{ + public sealed partial class FuncTest + { + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory.Tests/TestData/TestEntitySource.cs b/src/core-func-factory/Fanc.Factory.Tests/TestData/TestEntitySource.cs new file mode 100644 index 00000000..8ab2522f --- /dev/null +++ b/src/core-func-factory/Fanc.Factory.Tests/TestData/TestEntitySource.cs @@ -0,0 +1,55 @@ +#nullable enable + +using System.Collections.Generic; +using System.Linq; +using static PrimeFuncPack.UnitTest.TestData; + +namespace PrimeFuncPack.Core.Tests +{ + internal static class TestEntitySource + { + public static IEnumerable RefTypes + => + new[] + { + PlusFifteenIdRefType, + MinusFifteenIdRefType, + null + } + .ToNullableTestSourceValues(); + + public static IEnumerable RecordTypes + => + new[] + { + PlusFifteenIdSomeStringNameRecord, + MinusFifteenIdNullNameRecord, + ZeroIdNullNameRecord, + null + } + .ToNullableTestSourceValues(); + + public static IEnumerable StructTypes + => + new[] + { + SomeTextStructType, + NullTextStructType, + default + } + .ToTestSourceValues(); + + private static IEnumerable ToTestSourceValues( + this IEnumerable source) + where T : notnull + => + source.Select( + value => new object[] { value }); + + private static IEnumerable ToNullableTestSourceValues( + this IEnumerable source) + => + source.Select( + value => new object?[] { value }); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Fanc.Factory.csproj b/src/core-func-factory/Fanc.Factory/Fanc.Factory.csproj new file mode 100644 index 00000000..fd2b4028 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Fanc.Factory.csproj @@ -0,0 +1,28 @@ + + + + net5.0 + true + Andrei Sergeev, Pavel Moskovoy + true + true + LICENSE + PrimeFuncPack: A Functional Programming Pack for .NET + Copyright © 2020 Andrei Sergeev, Pavel Moskovoy + System + PrimeFuncPack.Core.Func.Factory + 1.0.0-preview.1.1.0 + + + + + True + + + + + + + + + diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.00.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.00.cs new file mode 100644 index 00000000..9251e6d3 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.00.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.01.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.01.cs new file mode 100644 index 00000000..fa830e0d --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.01.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.02.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.02.cs new file mode 100644 index 00000000..149fea76 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.02.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.03.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.03.cs new file mode 100644 index 00000000..886db2c0 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.03.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.04.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.04.cs new file mode 100644 index 00000000..553a1bf8 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.04.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.05.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.05.cs new file mode 100644 index 00000000..33fab03c --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.05.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.06.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.06.cs new file mode 100644 index 00000000..e914273e --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.06.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.07.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.07.cs new file mode 100644 index 00000000..9f272163 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.07.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.08.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.08.cs new file mode 100644 index 00000000..c1591223 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.08.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.09.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.09.cs new file mode 100644 index 00000000..95ced59f --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.09.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.10.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.10.cs new file mode 100644 index 00000000..5f66cc23 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.10.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.11.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.11.cs new file mode 100644 index 00000000..80a53a1b --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.11.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.12.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.12.cs new file mode 100644 index 00000000..7fddb179 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.12.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.13.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.13.cs new file mode 100644 index 00000000..dc5c1781 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.13.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.14.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.14.cs new file mode 100644 index 00000000..dee6f5f8 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.14.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.15.cs b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.15.cs new file mode 100644 index 00000000..ece9a497 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/AsyncFactory/AsyncFactory.15.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + partial class Func + { + public static IAsyncFunc Create( + Func> func) + => + new ImplAsyncFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.00.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.00.cs new file mode 100644 index 00000000..364e5c76 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.00.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.01.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.01.cs new file mode 100644 index 00000000..683be587 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.01.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.02.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.02.cs new file mode 100644 index 00000000..c5351be3 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.02.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.03.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.03.cs new file mode 100644 index 00000000..c4c2f3ab --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.03.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.04.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.04.cs new file mode 100644 index 00000000..25236d2e --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.04.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.05.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.05.cs new file mode 100644 index 00000000..0247cf9e --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.05.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.06.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.06.cs new file mode 100644 index 00000000..6d34c195 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.06.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.07.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.07.cs new file mode 100644 index 00000000..058ecd80 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.07.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.08.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.08.cs new file mode 100644 index 00000000..c80bb125 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.08.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.09.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.09.cs new file mode 100644 index 00000000..73409eb1 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.09.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.10.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.10.cs new file mode 100644 index 00000000..f275a639 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.10.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.11.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.11.cs new file mode 100644 index 00000000..5d3be5b8 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.11.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.12.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.12.cs new file mode 100644 index 00000000..1af7220a --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.12.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.13.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.13.cs new file mode 100644 index 00000000..10de44ae --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.13.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.14.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.14.cs new file mode 100644 index 00000000..4cbd19c1 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.14.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.15.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.15.cs new file mode 100644 index 00000000..f3b8b974 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.15.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.16.cs b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.16.cs new file mode 100644 index 00000000..037a1f31 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Factory/Factory.16.cs @@ -0,0 +1,13 @@ +#nullable enable + +namespace System +{ + partial class Func + { + public static IFunc Create( + Func func) + => + new ImplFunc( + func ?? throw new ArgumentNullException(nameof(func))); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Func/Func.cs b/src/core-func-factory/Fanc.Factory/Func/Func.cs new file mode 100644 index 00000000..904b16f6 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Func/Func.cs @@ -0,0 +1,8 @@ +#nullable enable + +namespace System +{ + public static partial class Func + { + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.00.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.00.cs new file mode 100644 index 00000000..ef11dc21 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.00.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(CancellationToken cancellationToken = default) + => + func.Invoke(cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.01.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.01.cs new file mode 100644 index 00000000..22ccacb7 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.01.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T arg, CancellationToken cancellationToken = default) + => + func.Invoke(arg, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.02.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.02.cs new file mode 100644 index 00000000..35d400c2 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.02.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.03.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.03.cs new file mode 100644 index 00000000..b4ddecf1 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.03.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.04.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.04.cs new file mode 100644 index 00000000..6c62dbd3 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.04.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.05.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.05.cs new file mode 100644 index 00000000..8de36b97 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.05.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.06.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.06.cs new file mode 100644 index 00000000..ee6e6715 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.06.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.07.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.07.cs new file mode 100644 index 00000000..e617f82f --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.07.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.08.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.08.cs new file mode 100644 index 00000000..e8806d6e --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.08.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.09.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.09.cs new file mode 100644 index 00000000..04232ea2 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.09.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.10.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.10.cs new file mode 100644 index 00000000..fe26580e --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.10.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.11.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.11.cs new file mode 100644 index 00000000..e77fd8db --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.11.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.12.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.12.cs new file mode 100644 index 00000000..6ec7f63d --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.12.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.13.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.13.cs new file mode 100644 index 00000000..41890076 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.13.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.14.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.14.cs new file mode 100644 index 00000000..d037e42b --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.14.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.15.cs b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.15.cs new file mode 100644 index 00000000..a9e52601 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.AsyncFunc/ImplAsyncFunc.15.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + internal sealed class ImplAsyncFunc : IAsyncFunc + { + private readonly Func> func; + + public ImplAsyncFunc( + Func> func) + => + this.func = func; + + public ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, CancellationToken cancellationToken = default) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, cancellationToken); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.00.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.00.cs new file mode 100644 index 00000000..680fbaf9 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.00.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + internal sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke() + => + func.Invoke(); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.01.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.01.cs new file mode 100644 index 00000000..a9646ec8 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.01.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + internal sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T arg) + => + func.Invoke(arg); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.02.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.02.cs new file mode 100644 index 00000000..a9f8fcf5 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.02.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + internal sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2) + => + func.Invoke(arg1, arg2); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.03.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.03.cs new file mode 100644 index 00000000..af4ebc9f --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.03.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3) + => + func.Invoke(arg1, arg2, arg3); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.04.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.04.cs new file mode 100644 index 00000000..ea5daee4 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.04.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4) + => + func.Invoke(arg1, arg2, arg3, arg4); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.05.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.05.cs new file mode 100644 index 00000000..98986b0a --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.05.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.06.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.06.cs new file mode 100644 index 00000000..7b1f10b8 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.06.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.07.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.07.cs new file mode 100644 index 00000000..cdbab349 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.07.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.08.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.08.cs new file mode 100644 index 00000000..c8ef9239 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.08.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.09.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.09.cs new file mode 100644 index 00000000..f46d4328 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.09.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.10.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.10.cs new file mode 100644 index 00000000..603900f0 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.10.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.11.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.11.cs new file mode 100644 index 00000000..b2c82b6c --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.11.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.12.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.12.cs new file mode 100644 index 00000000..b2f59391 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.12.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.13.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.13.cs new file mode 100644 index 00000000..bf57f6ae --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.13.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.14.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.14.cs new file mode 100644 index 00000000..79242bf9 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.14.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.15.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.15.cs new file mode 100644 index 00000000..fe674ec9 --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.15.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); + } +} \ No newline at end of file diff --git a/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.16.cs b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.16.cs new file mode 100644 index 00000000..ac8ea20b --- /dev/null +++ b/src/core-func-factory/Fanc.Factory/Impl.Func/ImplFunc.16.cs @@ -0,0 +1,18 @@ +#nullable enable + +namespace System +{ + public sealed class ImplFunc : IFunc + { + private readonly Func func; + + public ImplFunc( + Func func) + => + this.func = func; + + public TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16) + => + func.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); + } +} \ No newline at end of file diff --git a/src/core-func/Func/Func.csproj b/src/core-func/Func/Func.csproj new file mode 100644 index 00000000..a2e514b4 --- /dev/null +++ b/src/core-func/Func/Func.csproj @@ -0,0 +1,24 @@ + + + + net5.0 + true + Andrei Sergeev, Pavel Moskovoy + true + true + LICENSE + PrimeFuncPack: A Functional Programming Pack for .NET + Copyright © 2020 Andrei Sergeev, Pavel Moskovoy + System + PrimeFuncPack.Core.Func + 1.0.0-preview.1.0.0 + + + + + True + + + + + diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.00.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.00.cs new file mode 100644 index 00000000..25048310 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.00.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.01.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.01.cs new file mode 100644 index 00000000..807f106f --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.01.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T arg, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.02.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.02.cs new file mode 100644 index 00000000..7562ea05 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.02.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.03.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.03.cs new file mode 100644 index 00000000..00c92a5b --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.03.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.04.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.04.cs new file mode 100644 index 00000000..840ffbae --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.04.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.05.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.05.cs new file mode 100644 index 00000000..6c444eb2 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.05.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.06.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.06.cs new file mode 100644 index 00000000..00d6023d --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.06.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.07.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.07.cs new file mode 100644 index 00000000..c196efef --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.07.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.08.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.08.cs new file mode 100644 index 00000000..da9b27f3 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.08.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.09.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.09.cs new file mode 100644 index 00000000..93e6aa52 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.09.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.10.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.10.cs new file mode 100644 index 00000000..1360fd97 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.10.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.11.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.11.cs new file mode 100644 index 00000000..33540d0c --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.11.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.12.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.12.cs new file mode 100644 index 00000000..f59837bf --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.12.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.13.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.13.cs new file mode 100644 index 00000000..0cbef0e1 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.13.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.14.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.14.cs new file mode 100644 index 00000000..9596f3ca --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.14.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.15.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.15.cs new file mode 100644 index 00000000..7405dfa1 --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.15.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IAsyncFunc/IAsyncFunc.16.cs b/src/core-func/Func/IAsyncFunc/IAsyncFunc.16.cs new file mode 100644 index 00000000..e944e3ab --- /dev/null +++ b/src/core-func/Func/IAsyncFunc/IAsyncFunc.16.cs @@ -0,0 +1,12 @@ +#nullable enable + +using System.Threading; +using System.Threading.Tasks; + +namespace System +{ + public interface IAsyncFunc + { + ValueTask InvokeAsync(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.00.cs b/src/core-func/Func/IFunc/IFunc.00.cs new file mode 100644 index 00000000..612725e1 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.00.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.01.cs b/src/core-func/Func/IFunc/IFunc.01.cs new file mode 100644 index 00000000..71852061 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.01.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T arg); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.02.cs b/src/core-func/Func/IFunc/IFunc.02.cs new file mode 100644 index 00000000..a3923135 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.02.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.03.cs b/src/core-func/Func/IFunc/IFunc.03.cs new file mode 100644 index 00000000..6f49f20d --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.03.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.04.cs b/src/core-func/Func/IFunc/IFunc.04.cs new file mode 100644 index 00000000..26617165 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.04.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.05.cs b/src/core-func/Func/IFunc/IFunc.05.cs new file mode 100644 index 00000000..ae110a0d --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.05.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.06.cs b/src/core-func/Func/IFunc/IFunc.06.cs new file mode 100644 index 00000000..980896c9 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.06.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.07.cs b/src/core-func/Func/IFunc/IFunc.07.cs new file mode 100644 index 00000000..2b7e7cf5 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.07.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.08.cs b/src/core-func/Func/IFunc/IFunc.08.cs new file mode 100644 index 00000000..e01487a9 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.08.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.09.cs b/src/core-func/Func/IFunc/IFunc.09.cs new file mode 100644 index 00000000..733e0aa0 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.09.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.10.cs b/src/core-func/Func/IFunc/IFunc.10.cs new file mode 100644 index 00000000..8eb5480b --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.10.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.11.cs b/src/core-func/Func/IFunc/IFunc.11.cs new file mode 100644 index 00000000..7d4eeaf1 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.11.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.12.cs b/src/core-func/Func/IFunc/IFunc.12.cs new file mode 100644 index 00000000..0761e0d9 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.12.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.13.cs b/src/core-func/Func/IFunc/IFunc.13.cs new file mode 100644 index 00000000..592de8cc --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.13.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.14.cs b/src/core-func/Func/IFunc/IFunc.14.cs new file mode 100644 index 00000000..804d2cb2 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.14.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.15.cs b/src/core-func/Func/IFunc/IFunc.15.cs new file mode 100644 index 00000000..cb4cdcec --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.15.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15); + } +} \ No newline at end of file diff --git a/src/core-func/Func/IFunc/IFunc.16.cs b/src/core-func/Func/IFunc/IFunc.16.cs new file mode 100644 index 00000000..93260748 --- /dev/null +++ b/src/core-func/Func/IFunc/IFunc.16.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace System +{ + public interface IFunc + { + TResult Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16); + } +} \ No newline at end of file diff --git a/src/core/Core/Core.csproj b/src/core/Core/Core.csproj index e2c8bbb2..09499893 100644 --- a/src/core/Core/Core.csproj +++ b/src/core/Core/Core.csproj @@ -11,7 +11,7 @@ Copyright © 2020 Andrei Sergeev, Pavel Moskovoy System PrimeFuncPack.Core - 1.0.0-preview.1.26.0 + 1.0.0-preview.1.26.1 @@ -23,6 +23,8 @@ + +