diff --git a/src/core/Dime.Linq.csproj b/src/core/Dime.Linq.csproj
index 2bbfc50..e8282a3 100644
--- a/src/core/Dime.Linq.csproj
+++ b/src/core/Dime.Linq.csproj
@@ -1,8 +1,8 @@
- net8.0;net9.0
- 1.4.0
+ net8.0;net9.0;net10.0
+ 1.5.0
Dime Software
latest
true
@@ -15,15 +15,15 @@
Copyright © 2024
linq
en
- 1.4.0.0
- 1.4.0.0
+ 1.5.0.0
+ 1.5.0.0
MIT
True
True
-
+
diff --git a/src/test/AggregateExtensionsTest.cs b/src/test/AggregateExtensionsTest.cs
index ef7637b..a00ce3c 100644
--- a/src/test/AggregateExtensionsTest.cs
+++ b/src/test/AggregateExtensionsTest.cs
@@ -20,7 +20,7 @@ public void AggregateExtensions_List_JoinString_DefaultSeparator_ShouldReturnCon
];
string allCustomers = customers.Aggregate(x => x.Id);
- Assert.IsTrue(allCustomers == "1,2,3,4");
+ Assert.AreEqual("1,2,3,4", allCustomers);
}
[TestMethod]
@@ -35,7 +35,7 @@ public void AggregateExtensions_List_JoinString_CustomSeparator_ShouldReturnConc
];
string allCustomers = customers.Aggregate(x => x.Id, ". ");
- Assert.IsTrue(allCustomers == "1. 2. 3. 4");
+ Assert.AreEqual("1. 2. 3. 4", allCustomers);
}
}
}
\ No newline at end of file
diff --git a/src/test/Dime.Linq.Tests.csproj b/src/test/Dime.Linq.Tests.csproj
index 2800dfe..4764570 100644
--- a/src/test/Dime.Linq.Tests.csproj
+++ b/src/test/Dime.Linq.Tests.csproj
@@ -1,15 +1,15 @@
- net8.0;net9.0
+ net8.0;net9.0;net10.0
false
latest
-
-
-
+
+
+
diff --git a/src/test/DistinctExtensionsTests.cs b/src/test/DistinctExtensionsTests.cs
index 52cdc78..f92a0c9 100644
--- a/src/test/DistinctExtensionsTests.cs
+++ b/src/test/DistinctExtensionsTests.cs
@@ -22,7 +22,7 @@ public void DistinctBy_Tuples_ShouldReturnDistinctItems()
new Tuple(6, new Customer(6, "Category 2", "Address 1"))
];
- Assert.IsTrue(customers.DistinctBy(x => x.Name).Count() == 3);
+ Assert.AreEqual(3, customers.DistinctBy(x => x.Name).Count());
}
[TestMethod]
@@ -38,7 +38,7 @@ public void DistinctBy_List_ShouldReturnDistinctItems()
new Customer(6, "Category 2", "Address 1")
];
- Assert.IsTrue(customers.DistinctBy(x => x.Name).Count() == 3);
+ Assert.AreEqual(3, customers.DistinctBy(x => x.Name).Count());
}
[TestMethod]
@@ -54,7 +54,7 @@ public void DistinctBy_List_Filter_ShouldReturnDistinctItems()
new Customer(6, "Category 2", "Address 1")
];
- Assert.IsTrue(customers.DistinctBy(x => x.Name, x => x.Id != 4).Count() == 2);
+ Assert.AreEqual(2, customers.DistinctBy(x => x.Name, x => x.Id != 4).Count());
}
}
}
\ No newline at end of file
diff --git a/src/test/ExceptionHandlerTests.cs b/src/test/ExceptionHandlerTests.cs
index 19b18a3..e400b7e 100644
--- a/src/test/ExceptionHandlerTests.cs
+++ b/src/test/ExceptionHandlerTests.cs
@@ -19,7 +19,7 @@ public void CatchExceptions_LoopsWithoutErrors()
];
List clients = customers.Select(x => new Client { Id = x.Id }).CatchExceptions(x => { }).ToList();
- Assert.IsTrue(clients.Count() == 2);
+ Assert.AreEqual(2, clients.Count());
}
}
}
\ No newline at end of file
diff --git a/src/test/FirstExtensionsTests.cs b/src/test/FirstExtensionsTests.cs
index 016128d..fb6beae 100644
--- a/src/test/FirstExtensionsTests.cs
+++ b/src/test/FirstExtensionsTests.cs
@@ -13,7 +13,7 @@ public class FirstExtensionsTests
public void First_SourceIsNull_ThrowsException()
{
List customers = null;
- Assert.ThrowsException(() => customers.First(x => x.Id > 0, x => x.Name != "Handsome B. Wonderful"));
+ Assert.Throws(() => customers.First(x => x.Id > 0, x => x.Name != "Handsome B. Wonderful"));
}
[TestMethod]
@@ -27,7 +27,7 @@ public void First_FirstFilterPasses_ReturnsItem()
];
Customer firstCustomer = customers.First(x => x.Id > 0, x => x.Name != "Handsome B. Wonderful");
- Assert.IsTrue(firstCustomer.Id == 1);
+ Assert.AreEqual(1, firstCustomer.Id);
}
[TestMethod]
@@ -41,7 +41,7 @@ public void First_SecondFilterPasses_ReturnsItem()
];
Customer firstCustomer = customers.First(x => x.Id > 1, x => x.Name == "Handsome B. Wonderful");
- Assert.IsTrue(firstCustomer.Id == 5);
+ Assert.AreEqual(5, firstCustomer.Id);
}
[TestMethod]
@@ -55,7 +55,7 @@ public void First_NoFilterPasses_ReturnsDefault()
];
Customer firstCustomer = customers.First(x => x.Id > 15, x => x.Name == "Handsome B. Wonderful");
- Assert.IsTrue(firstCustomer.Id == 1);
+ Assert.AreEqual(1, firstCustomer.Id);
}
[TestMethod]
@@ -63,7 +63,7 @@ public void FirstOrDefault_SourceIsNull_ThrowsException()
{
List customers = null;
- Assert.ThrowsException(() => customers.FirstOrDefault(x => x.Id > 0, x => x.Name != "Handsome B. Wonderful"));
+ Assert.Throws(() => customers.FirstOrDefault(x => x.Id > 0, x => x.Name != "Handsome B. Wonderful"));
}
[TestMethod]
@@ -77,7 +77,7 @@ public void FirstOrDefault_FirstFilterPasses_ReturnsItem()
];
Customer firstCustomer = customers.FirstOrDefault(x => x.Id > 0, x => x.Name != "Handsome B. Wonderful");
- Assert.IsTrue(firstCustomer.Id == 1);
+ Assert.AreEqual(1, firstCustomer.Id);
}
[TestMethod]
@@ -91,7 +91,7 @@ public void FirstOrDefault_SecondFilterPasses_ReturnsItem()
];
Customer firstCustomer = customers.FirstOrDefault(x => x.Id > 1, x => x.Name == "Handsome B. Wonderful");
- Assert.IsTrue(firstCustomer.Id == 5);
+ Assert.AreEqual(5, firstCustomer.Id);
}
[TestMethod]
@@ -105,7 +105,7 @@ public void FirstOrDefault_NoFilterPasses_ReturnsDefault()
];
Customer firstCustomer = customers.FirstOrDefault(x => x.Id > 15, x => x.Name == "Handsome B. Wonderful");
- Assert.IsTrue(firstCustomer.Id == 1);
+ Assert.AreEqual(1, firstCustomer.Id);
}
}
}
\ No newline at end of file
diff --git a/src/test/ForkExtensions.cs b/src/test/ForkExtensions.cs
index 916f581..c088116 100644
--- a/src/test/ForkExtensions.cs
+++ b/src/test/ForkExtensions.cs
@@ -20,8 +20,8 @@ public void Fork_WithDataInBothSets_ShouldSplitIntoTwo_PopulatedSets()
(IEnumerable success, IEnumerable failed) = customers.Fork(x => x.Address == "Bumtown");
- Assert.IsTrue(success.Count() == 2);
- Assert.IsTrue(failed.Count() == 1);
+ Assert.AreEqual(2, success.Count());
+ Assert.AreEqual(1, failed.Count());
}
[TestMethod]
@@ -35,7 +35,7 @@ public void Fork_WithEmptyDataInOneSet_ShouldSplitIntoTwo_EmptyCollection()
(IEnumerable success, IEnumerable failed) = customers.Fork(x => x.Address == "Bumtown");
- Assert.IsTrue(success.Count() == 2);
+ Assert.AreEqual(2, success.Count());
Assert.IsTrue(!failed.Any());
}
@@ -52,7 +52,7 @@ public void Fork_WithEmptyDataInBothSet_ShouldSplitIntoTwo_NoData()
(IEnumerable success, IEnumerable failed) = customers.Fork(x => x.Address == "Not Bumtown");
Assert.IsTrue(!success.Any());
- Assert.IsTrue(failed.Count() == 3);
+ Assert.AreEqual(3, failed.Count());
}
}
}
\ No newline at end of file
diff --git a/src/test/GroupExtensionsTests.cs b/src/test/GroupExtensionsTests.cs
index 0996504..d99cb92 100644
--- a/src/test/GroupExtensionsTests.cs
+++ b/src/test/GroupExtensionsTests.cs
@@ -21,16 +21,16 @@ public void GroupByMany_NoDuplicates_ShouldReturnFlatGroup()
];
List> groups = customers.GroupByMany(x => x.Name, x => x.Address).ToList();
- Assert.IsTrue(groups.Count == 5);
+ Assert.AreEqual(5, groups.Count);
- Assert.IsTrue(
- groups
+ Assert.AreEqual(
+1, groups
.FirstOrDefault(x =>
{
object[] keys = x.Key as object[];
return (string)keys[0] == "Jeff" && (string)keys[1] == "New York";
})
- .Count() == 1);
+ .Count());
}
[TestMethod]
@@ -46,16 +46,16 @@ public void GroupByMany_HasDuplicates_ShouldReturnNestedGroups()
];
List> groups = customers.GroupByMany(x => x.Name, x => x.Address).ToList();
- Assert.IsTrue(groups.Count == 4);
+ Assert.AreEqual(4, groups.Count);
- Assert.IsTrue(
- groups
+ Assert.AreEqual(
+2, groups
.FirstOrDefault(x =>
{
object[] keys = x.Key as object[];
return (string)keys[0] == "Jeff" && (string)keys[1] == "New York";
})
- .Count() == 2);
+ .Count());
}
}
}
\ No newline at end of file
diff --git a/src/test/JoinExtensionsTests.cs b/src/test/JoinExtensionsTests.cs
index e44b5fa..5bc58d6 100644
--- a/src/test/JoinExtensionsTests.cs
+++ b/src/test/JoinExtensionsTests.cs
@@ -26,8 +26,8 @@ public void Join_SameType_ReturnsCollectionTwoWithDataFromCollectionOne()
];
IEnumerable mergedLists = customers1.Merge(customers2, (x, y) => new Customer(y.Id, x.Name, x.Address));
- Assert.IsTrue(mergedLists.Count() == 3);
- Assert.IsTrue(mergedLists.ElementAt(0).Name == "Customer 1");
+ Assert.AreEqual(3, mergedLists.Count());
+ Assert.AreEqual("Customer 1", mergedLists.ElementAt(0).Name);
}
[TestMethod]
@@ -49,8 +49,8 @@ public void Join_SameType_ListOneHasMoreItems_ReturnsCollectionTwoWithDataFromCo
];
IEnumerable mergedLists = customers1.Merge(customers2, (x, y) => new Customer(y.Id, x.Name, x.Address));
- Assert.IsTrue(mergedLists.Count() == 4);
- Assert.IsTrue(mergedLists.ElementAt(0).Name == "Customer 1");
+ Assert.AreEqual(4, mergedLists.Count());
+ Assert.AreEqual("Customer 1", mergedLists.ElementAt(0).Name);
}
[TestMethod]
@@ -72,8 +72,8 @@ public void Join_SameType_ListTwoHasMoreItems_ReturnsCollectionTwoWithDataFromCo
];
IEnumerable mergedLists = customers1.Merge(customers2, (x, y) => new Customer(y.Id, x.Name, x.Address));
- Assert.IsTrue(mergedLists.Count() == 4);
- Assert.IsTrue(mergedLists.ElementAt(0).Name == "Customer 1");
+ Assert.AreEqual(4, mergedLists.Count());
+ Assert.AreEqual("Customer 1", mergedLists.ElementAt(0).Name);
}
[TestMethod]
@@ -94,8 +94,8 @@ public void Join_DifferentType_ReturnsCollectionTwoWithDataFromCollectionOne()
];
IEnumerable mergedLists = customers1.Merge(customers2, (x, y) => new Client(y.Id, x.Name, x.Address));
- Assert.IsTrue(mergedLists.Count() == 3);
- Assert.IsTrue(mergedLists.ElementAt(0).Name == "Customer 1");
+ Assert.AreEqual(3, mergedLists.Count());
+ Assert.AreEqual("Customer 1", mergedLists.ElementAt(0).Name);
}
[TestMethod]
@@ -117,8 +117,8 @@ public void Join_DifferentType_FirstListHasMoreItems_ReturnsCollectionTwoWithDat
];
IEnumerable mergedLists = customers1.Merge(customers2, (x, y) => new Client(y?.Id ?? x.Id, x?.Name ?? y.Name, x?.Address ?? y.Address));
- Assert.IsTrue(mergedLists.Count() == 4);
- Assert.IsTrue(mergedLists.ElementAt(0).Name == "Customer 1");
+ Assert.AreEqual(4, mergedLists.Count());
+ Assert.AreEqual("Customer 1", mergedLists.ElementAt(0).Name);
}
[TestMethod]
@@ -140,8 +140,8 @@ public void Join_DifferentType_SecondListHasMoreItems_ReturnsCollectionTwoWithDa
];
IEnumerable mergedLists = customers1.Merge(customers2, (x, y) => new Client(y?.Id ?? x.Id, x?.Name ?? y.Name, x?.Address ?? y.Address));
- Assert.IsTrue(mergedLists.Count() == 4);
- Assert.IsTrue(mergedLists.ElementAt(0).Name == "Customer 1");
+ Assert.AreEqual(4, mergedLists.Count());
+ Assert.AreEqual("Customer 1", mergedLists.ElementAt(0).Name);
}
[TestMethod]
@@ -170,8 +170,8 @@ public void FullOuterJoin()
new Client(0, "Unknown client", ""))
.ToList();
- Assert.IsTrue(mergedLists.Count() == 5);
- Assert.IsTrue(mergedLists.ElementAt(2).Name == "Customer 3");
+ Assert.AreEqual(5, mergedLists.Count());
+ Assert.AreEqual("Customer 3", mergedLists.ElementAt(2).Name);
}
[TestMethod]
@@ -201,9 +201,9 @@ public void FullOuterGroupJoin_Matches_ShouldJoin()
})
.ToList();
- Assert.IsTrue(groups.Count == 2);
- Assert.IsTrue(groups.ElementAt(0) == "Jose Guerrero Delgado");
- Assert.IsTrue(groups.ElementAt(1) == "Karen Smith");
+ Assert.AreEqual(2, groups.Count);
+ Assert.AreEqual("Jose Guerrero Delgado", groups.ElementAt(0));
+ Assert.AreEqual("Karen Smith", groups.ElementAt(1));
}
[TestMethod]
@@ -229,10 +229,10 @@ public void LeftOuterJoin_ShouldJoin()
(a, b) => a.Name + " " + b.LastName)
.ToList();
- Assert.IsTrue(groups.Count == 3);
- Assert.IsTrue(groups.ElementAt(0) == "Jose Guerrero");
- Assert.IsTrue(groups.ElementAt(1) == "Jose Delgado");
- Assert.IsTrue(groups.ElementAt(2) == "Karen Smith");
+ Assert.AreEqual(3, groups.Count);
+ Assert.AreEqual("Jose Guerrero", groups.ElementAt(0));
+ Assert.AreEqual("Jose Delgado", groups.ElementAt(1));
+ Assert.AreEqual("Karen Smith", groups.ElementAt(2));
}
}
}
\ No newline at end of file
diff --git a/src/test/PipeTests.cs b/src/test/PipeTests.cs
index 541c29a..bd4ff7d 100644
--- a/src/test/PipeTests.cs
+++ b/src/test/PipeTests.cs
@@ -20,7 +20,7 @@ public void Pipe()
];
string allCustomers = customers.Select(x => x.Id).Pipe(x => string.Join(",", x));
- Assert.IsTrue(allCustomers == "1,2,3,4");
+ Assert.AreEqual("1,2,3,4", allCustomers);
}
}
}
\ No newline at end of file
diff --git a/src/test/SelectExtensionsTests.cs b/src/test/SelectExtensionsTests.cs
index 1f9e6d0..0a40dd7 100644
--- a/src/test/SelectExtensionsTests.cs
+++ b/src/test/SelectExtensionsTests.cs
@@ -19,7 +19,7 @@ static bool ParseId(Client client, out int number)
}
List customers = null;
- Assert.ThrowsException(() => customers.SelectTry(x => new Client() { Id = x.Id }, ParseId).ToList());
+ Assert.Throws(() => customers.SelectTry(x => new Client() { Id = x.Id }, ParseId).ToList());
}
[TestMethod]
@@ -39,7 +39,7 @@ static bool ParseId(Client client, out int number)
];
IEnumerable identifiers = customers.SelectTry(x => new Client() { Id = x.Id }, ParseId);
- Assert.IsTrue(identifiers.Sum() == 21);
+ Assert.AreEqual(21, identifiers.Sum());
}
[TestMethod]
@@ -47,7 +47,7 @@ public void ConvertTo_IntToLong_ShouldReturnNewList()
{
IEnumerable integerList = new List { 1, 2, 3, 4, 5 };
IEnumerable longList = integerList.ConvertTo();
- Assert.IsTrue(longList.Count() == 5);
+ Assert.AreEqual(5, longList.Count());
}
}
}
\ No newline at end of file