diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 88cc537..361bedc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,19 +2,26 @@ name: ci
on: [push]
+# Allow one run of this workflow per branch and cancel existing runs if triggered again
+concurrency:
+ group: fruityfoundation-ci-${{ github.ref_name }}
+ cancel-in-progress: true
+
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
- dotnet-version: ['6.0.x']
+ dotnet-version: ['7.0.x', '6.0.x']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
- dotnet-version: "6.0.x"
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml
old mode 100755
new mode 100644
index 8ba9769..a7f0444
--- a/.github/workflows/publish-release.yml
+++ b/.github/workflows/publish-release.yml
@@ -21,7 +21,7 @@ jobs:
fetch-depth: '0' # Load entire history
- uses: actions/setup-dotnet@v3
with:
- dotnet-version: '6.x'
+ dotnet-version: '7.x'
- run: dotnet tool restore
- name: Generate Version
id: generate-version
diff --git a/Base.Tests/Base.Tests.csproj b/Base.Tests/Base.Tests.csproj
old mode 100755
new mode 100644
index d23458e..18a419f
--- a/Base.Tests/Base.Tests.csproj
+++ b/Base.Tests/Base.Tests.csproj
@@ -1,10 +1,11 @@
- net6.0
enable
false
+
+ net6.0;net7.0
@@ -21,4 +22,5 @@
+
diff --git a/Base.Tests/Extensions/EnumerableExtensionTests.cs b/Base.Tests/Extensions/EnumerableExtensionTests.cs
deleted file mode 100644
index 1b0f0e7..0000000
--- a/Base.Tests/Extensions/EnumerableExtensionTests.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Linq;
-using FruityFoundation.Base.Extensions;
-using NUnit.Framework;
-
-namespace Base.Tests.Extensions;
-
-public class EnumerableExtensionTests
-{
- [TestCase(new object[] { 0, 1, 2 }, true, new object[] { 85 }, ExpectedResult = new object[] { 0, 1, 2, 85 })]
- [TestCase(new object[] { "hi" }, false, new object[] { "there" }, ExpectedResult = new object[] { "hi" })]
- public object[] TestConditionalConcat(object[] input, bool isConditionValid, object[] second) =>
- input.ConditionalConcat(isConditionValid, second).ToArray();
-
- [TestCase(new object[] { 0, 1, 2 }, true, 85, ExpectedResult = new object[0])]
- [TestCase(new object[] { "hi", "there" }, false, "there", ExpectedResult = new object[] { "hi", "there" })]
- public object[] TestConditionalWhere(object[] input, bool isConditionValid, object valueToKeep) =>
- input.ConditionalWhere(isConditionValid, x => x.Equals(valueToKeep)).ToArray();
-
- [Test]
- public void TestChooseWithRefType()
- {
- var input = new [] { "one", null, "two" };
-
- var result = input.Choose(x => x).ToArray();
-
- Assert.That(result.GetType(), Is.EqualTo(typeof(string[])));
- Assert.That(result.Length, Is.EqualTo(2));
- Assert.That(result[0], Is.EqualTo("one"));
- Assert.That(result[1], Is.EqualTo("two"));
- }
-
- [Test]
- public void TestChooseWithValueType()
- {
- var input = new int?[] { 1, null, 2 };
-
- var result = input.Choose(x => x).ToArray();
-
- Assert.That(result.GetType(), Is.EqualTo(typeof(int[])));
- Assert.That(result.GetType(), Is.Not.EqualTo(typeof(int?[])));
- Assert.That(result.Length, Is.EqualTo(2));
- Assert.That(result[0], Is.EqualTo(1));
- Assert.That(result[1], Is.EqualTo(2));
- }
-}
\ No newline at end of file
diff --git a/Base.Tests/Extensions/MaybeExtensionTests.cs b/Base.Tests/Extensions/MaybeExtensionTests.cs
deleted file mode 100644
index faa0630..0000000
--- a/Base.Tests/Extensions/MaybeExtensionTests.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using FruityFoundation.Base.Extensions;
-using FruityFoundation.Base.Structures;
-using NUnit.Framework;
-
-namespace Base.Tests.Extensions;
-
-public class MaybeExtensionTests
-{
- [Test]
- public void EnumerableFirstOrEmptyTests()
- {
- Assert.AreEqual(Maybe.Empty(), Array.Empty().FirstOrEmpty());
- Assert.AreEqual(Maybe.Create("banana"), new[] { "banana" }.FirstOrEmpty());
- }
-
- [Test]
- public void TestToMaybe()
- {
- Assert.AreEqual(Maybe.Empty(), Maybe.Empty());
- Assert.AreEqual(Maybe.Create("banana"), "banana".ToMaybe());
- Assert.AreNotEqual(Maybe.Create(293921), Maybe.Create(2));
- }
-
- [Test]
- public void MaybeNullableTests()
- {
- Assert.IsNull(Maybe.Empty().ToNullable());
- Assert.IsNull(Maybe.Create(0, _ => false).ToNullable());
- }
-}
\ No newline at end of file
diff --git a/Base.Tests/Extensions/NullableExtensionTests.cs b/Base.Tests/Extensions/NullableExtensionTests.cs
deleted file mode 100644
index 07ab065..0000000
--- a/Base.Tests/Extensions/NullableExtensionTests.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using FruityFoundation.Base.Extensions;
-using FruityFoundation.Base.Structures;
-using NUnit.Framework;
-
-namespace Base.Tests.Extensions;
-
-public class NullableExtensionTests
-{
- [Test]
- public void TestNullableStructOfNullToMaybe() =>
- Assert.AreEqual(Maybe.Empty(), ((int?)null).ToMaybe());
-
- [Test]
- public void TestNullableStructOfValueToMaybe() =>
- Assert.AreEqual(Maybe.Create(25), ((int?)25).ToMaybe());
-
- [Test]
- public void TestNullableRefOfNullToMaybe() =>
- Assert.AreEqual(Maybe