Skip to content

Commit

Permalink
Merge pull request #66 from pfpack/feature/CoreDev
Browse files Browse the repository at this point in the history
CoreDev: Unit / Core
  • Loading branch information
pmosk authored Feb 7, 2021
2 parents b416976 + dc66bc4 commit 61829ae
Show file tree
Hide file tree
Showing 150 changed files with 1,742 additions and 565 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#nullable enable

using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;

namespace PrimeFuncPack.Core.Tests
{
partial class OptionalLinqDictionariesExtensionsTest
{
[Test]
public void TryGetValueOrAbsent_ExpectIsObsolete()
{
const string expectedObsoleteMessage = "This method is not intended for use. Call GetValueOrAbsent instead.";

IReadOnlyCollection<MethodInfo> methods = typeof(OptionalLinqDictionariesExtensions)
.GetMethods(BindingFlags.Public | BindingFlags.Static)
.Where(method => method.Name == nameof(OptionalLinqDictionariesExtensions.TryGetValueOrAbsent))
.ToArray();

Assert.AreEqual(2, methods.Count);

Assert.IsTrue(
methods.All(
method => method.CustomAttributes.Any(
attr
=>
attr.AttributeType == typeof(ObsoleteAttribute) &&
attr.ConstructorArguments.Count == 2 &&
attr.ConstructorArguments[0].ArgumentType == typeof(string) &&
attr.ConstructorArguments[0].Value is expectedObsoleteMessage &&
attr.ConstructorArguments[1].ArgumentType == typeof(bool) &&
attr.ConstructorArguments[1].Value is true)));

Assert.IsTrue(
methods.All(
method => method.CustomAttributes.Any(
attr
=>
attr.AttributeType == typeof(DoesNotReturnAttribute))));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ partial class OptionalLinqDictionariesExtensions
{
private static class ObsoleteMessages
{
public const string TryGetValueOrAbsent = "This method is obsolete. Call GetValueOrAbsent instead.";
public const string TryGetValueOrAbsent = "This method is not intended for use. Call GetValueOrAbsent instead.";
}
}
}
6 changes: 3 additions & 3 deletions src/core-taggeds-optional/Optional/Optional.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Copyright>Copyright © 2020 Andrei Sergeev, Pavel Moskovoy</Copyright>
<RootNamespace>System</RootNamespace>
<AssemblyName>PrimeFuncPack.Core.Optional</AssemblyName>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,8 +22,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PrimeFuncPack.Primitives" Version="1.0.1" />
<PackageReference Include="PrimeFuncPack.Core.Unit" Version="1.0.1" />
<PackageReference Include="PrimeFuncPack.Primitives" Version="1.0.*" />
<PackageReference Include="PrimeFuncPack.Core.Unit" Version="1.0.*" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/core-taggeds-result/Result/Result.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Copyright>Copyright © 2020 Andrei Sergeev, Pavel Moskovoy</Copyright>
<RootNamespace>System</RootNamespace>
<AssemblyName>PrimeFuncPack.Core.Result</AssemblyName>
<Version>1.0.0-preview.1.21</Version>
<Version>1.0.0-preview.1.23</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PrimeFuncPack.Core.TaggedUnion" Version="1.0.2" />
<PackageReference Include="PrimeFuncPack.Core.TaggedUnion" Version="1.0.3" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/core-taggeds-tagged-union/TaggedUnion/TaggedUnion.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Copyright>Copyright © 2020 Andrei Sergeev, Pavel Moskovoy</Copyright>
<RootNamespace>System</RootNamespace>
<AssemblyName>PrimeFuncPack.Core.TaggedUnion</AssemblyName>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PrimeFuncPack.Core.Optional" Version="1.0.2" />
<PackageReference Include="PrimeFuncPack.Core.Optional" Version="1.0.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_00_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_01_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_02_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_03_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_04_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_05_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_06_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_07_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_08_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_09_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_10_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_11_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_12_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_13_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_14_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_15_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitAsyncFuncExtensionsTests
partial class UnitExtensionsInvokeAsyncTests
{
[Test]
public void InvokeThenToUnitAsync_16_FuncIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PrimeFuncPack.Core.Tests
{
public sealed partial class InvokeThenToUnitAsyncFuncExtensionsTests
public sealed partial class UnitExtensionsInvokeAsyncTests
{
private const int MinusFortyFive = -45;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_00_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_01_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_02_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_03_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_04_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_05_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_06_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_07_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_08_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_09_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_10_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_11_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_12_ActionIsNull_ExpectArgumentNullException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace PrimeFuncPack.Core.Tests
{
partial class InvokeThenToUnitActionExtensionsTests
partial class UnitExtensionsInvokeTests
{
[Test]
public void InvokeThenToUnit_13_ActionIsNull_ExpectArgumentNullException()
Expand Down
Loading

0 comments on commit 61829ae

Please sign in to comment.