Skip to content

Commit

Permalink
Applied quality suggestions from Rider
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesalvo committed Feb 9, 2025
1 parent c246224 commit 6f41083
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion RDFSharp.Test/Model/Facets/RDFMaxExclusiveFacetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ShouldCreateMaxExclusiveFacet()
RDFMaxExclusiveFacet facet = new RDFMaxExclusiveFacet(6.145);

Assert.IsNotNull(facet);
Assert.IsTrue(facet.ExclusiveUpperBound == 6.145d);
Assert.AreEqual(6.145d, facet.ExclusiveUpperBound);
Assert.IsTrue(facet.URI.IsBlank);
}

Expand Down
2 changes: 1 addition & 1 deletion RDFSharp.Test/Model/Facets/RDFMaxInclusiveFacetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ShouldCreateMaxInclusiveFacet()
RDFMaxInclusiveFacet facet = new RDFMaxInclusiveFacet(6.145);

Assert.IsNotNull(facet);
Assert.IsTrue(facet.InclusiveUpperBound == 6.145d);
Assert.AreEqual(6.145d, facet.InclusiveUpperBound);
Assert.IsTrue(facet.URI.IsBlank);
}

Expand Down
2 changes: 1 addition & 1 deletion RDFSharp.Test/Model/Facets/RDFMinExclusiveFacetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ShouldCreateMinExclusiveFacet()
RDFMinExclusiveFacet facet = new RDFMinExclusiveFacet(6.145);

Assert.IsNotNull(facet);
Assert.IsTrue(facet.ExclusiveLowerBound == 6.145d);
Assert.AreEqual(6.145d, facet.ExclusiveLowerBound);
Assert.IsTrue(facet.URI.IsBlank);
}

Expand Down
2 changes: 1 addition & 1 deletion RDFSharp.Test/Model/Facets/RDFMinInclusiveFacetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ShouldCreateMinInclusiveFacet()
RDFMinInclusiveFacet facet = new RDFMinInclusiveFacet(6.145);

Assert.IsNotNull(facet);
Assert.IsTrue(facet.InclusiveLowerBound == 6.145d);
Assert.AreEqual(6.145d, facet.InclusiveLowerBound);
Assert.IsTrue(facet.URI.IsBlank);
}

Expand Down
2 changes: 1 addition & 1 deletion RDFSharp.Test/Model/RDFResourceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void ShouldCreateResourceExploitingHashContext()
RDFTriple triple4 = new RDFTriple(res1, res2CacheHitB, res3);
RDFTriple triple5 = new RDFTriple(res1CacheHitA, res2CacheHitA, res3);
RDFTriple triple6 = new RDFTriple(res1CacheHitA, res2CacheHitB, res3);
RDFGraph graph = new RDFGraph([triple1, triple2, triple3, triple4, triple5, triple6]);
_ = new RDFGraph([triple1, triple2, triple3, triple4, triple5, triple6]);

//Now we have materialized the lazy promises and calculated the hashes, exploiting the cache for boosting performances
Assert.IsTrue(hashContext.Count == 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -43,11 +43,11 @@ public void ShouldCreateAvgAggregator()

[TestMethod]
public void ShouldThrowExceptionOnCreatingAvgAggregatorBecauseNullAggregatorVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFAvgAggregator(null as RDFVariable, new RDFVariable("?PROJVAR")));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFAvgAggregator(null, new RDFVariable("?PROJVAR")));

[TestMethod]
public void ShouldThrowExceptionOnCreatingAvgAggregatorBecauseNullPartitionVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFAvgAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFAvgAggregator(new RDFVariable("?AGGVAR"), null));

[TestMethod]
public void ShouldCreateDistinctAvgAggregator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -43,11 +43,11 @@ public void ShouldCreateCountAggregator()

[TestMethod]
public void ShouldThrowExceptionOnCreatingCountAggregatorBecauseNullAggregatorVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFCountAggregator(null as RDFVariable, new RDFVariable("?PROJVAR")));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFCountAggregator(null, new RDFVariable("?PROJVAR")));

[TestMethod]
public void ShouldThrowExceptionOnCreatingCountAggregatorBecauseNullPartitionVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFCountAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFCountAggregator(new RDFVariable("?AGGVAR"), null));

[TestMethod]
public void ShouldCreateDistinctCountAggregator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -79,11 +79,11 @@ public void ShouldCreateGroupConcatAggregatorWithDefaultSeparator()

[TestMethod]
public void ShouldThrowExceptionOnCreatingGroupConcatAggregatorBecauseNullAggregatorVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFGroupConcatAggregator(null as RDFVariable, new RDFVariable("?PROJVAR"), ";"));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFGroupConcatAggregator(null, new RDFVariable("?PROJVAR"), ";"));

[TestMethod]
public void ShouldThrowExceptionOnCreatingGroupConcatAggregatorBecauseNullPartitionVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFGroupConcatAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable, ";"));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFGroupConcatAggregator(new RDFVariable("?AGGVAR"), null, ";"));

[TestMethod]
public void ShouldApplyModifierWithGroupConcatAggregator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -48,13 +48,13 @@ public void ShouldCreateMaxAggregator(RDFQueryEnums.RDFMinMaxAggregatorFlavors a
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.Numeric)]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.String)]
public void ShouldThrowExceptionOnCreatingStringMaxAggregatorBecauseNullAggregatorVariable(RDFQueryEnums.RDFMinMaxAggregatorFlavors aggregatorFlavor)
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMaxAggregator(null as RDFVariable, new RDFVariable("?PROJVAR"), aggregatorFlavor));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMaxAggregator(null, new RDFVariable("?PROJVAR"), aggregatorFlavor));

[DataTestMethod]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.Numeric)]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.String)]
public void ShouldThrowExceptionOnCreatingStringMaxAggregatorBecauseNullPartitionVariable(RDFQueryEnums.RDFMinMaxAggregatorFlavors aggregatorFlavor)
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMaxAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable, aggregatorFlavor));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMaxAggregator(new RDFVariable("?AGGVAR"), null, aggregatorFlavor));

[DataTestMethod]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.Numeric)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -48,13 +48,13 @@ public void ShouldCreateMinAggregator(RDFQueryEnums.RDFMinMaxAggregatorFlavors a
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.Numeric)]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.String)]
public void ShouldThrowExceptionOnCreatingStringMinAggregatorBecauseNullAggregatorVariable(RDFQueryEnums.RDFMinMaxAggregatorFlavors aggregatorFlavor)
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMinAggregator(null as RDFVariable, new RDFVariable("?PROJVAR"), aggregatorFlavor));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMinAggregator(null, new RDFVariable("?PROJVAR"), aggregatorFlavor));

[DataTestMethod]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.Numeric)]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.String)]
public void ShouldThrowExceptionOnCreatingStringMinAggregatorBecauseNullPartitionVariable(RDFQueryEnums.RDFMinMaxAggregatorFlavors aggregatorFlavor)
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMinAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable, aggregatorFlavor));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFMinAggregator(new RDFVariable("?AGGVAR"), null, aggregatorFlavor));

[DataTestMethod]
[DataRow(RDFQueryEnums.RDFMinMaxAggregatorFlavors.Numeric)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -43,11 +43,11 @@ public void ShouldCreatePartitionAggregator()

[TestMethod]
public void ShouldThrowExceptionOnCreatingPartitionAggregatorBecauseNullAggregatorVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFPartitionAggregator(null as RDFVariable, new RDFVariable("?PROJVAR")));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFPartitionAggregator(null, new RDFVariable("?PROJVAR")));

[TestMethod]
public void ShouldThrowExceptionOnCreatingPartitionAggregatorBecauseNullPartitionVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFPartitionAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFPartitionAggregator(new RDFVariable("?AGGVAR"), null));

[TestMethod]
public void ShouldCreateDistinctPartitionAggregator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -43,11 +43,11 @@ public void ShouldCreateSampleAggregator()

[TestMethod]
public void ShouldThrowExceptionOnCreatingSampleAggregatorBecauseNullAggregatorVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSampleAggregator(null as RDFVariable, new RDFVariable("?PROJVAR")));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSampleAggregator(null, new RDFVariable("?PROJVAR")));

[TestMethod]
public void ShouldThrowExceptionOnCreatingSampleAggregatorBecauseNullPartitionVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSampleAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSampleAggregator(new RDFVariable("?AGGVAR"), null));

[TestMethod]
public void ShouldCreateDistinctSampleAggregator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ You may obtain a copy of the License at
limitations under the License.
*/

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RDFSharp.Model;
using RDFSharp.Query;

Expand Down Expand Up @@ -43,11 +43,11 @@ public void ShouldCreateSumAggregator()

[TestMethod]
public void ShouldThrowExceptionOnCreatingSumAggregatorBecauseNullAggregatorVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSumAggregator(null as RDFVariable, new RDFVariable("?PROJVAR")));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSumAggregator(null, new RDFVariable("?PROJVAR")));

[TestMethod]
public void ShouldThrowExceptionOnCreatingSumAggregatorBecauseNullPartitionVariable()
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSumAggregator(new RDFVariable("?AGGVAR"), null as RDFVariable));
=> Assert.ThrowsException<RDFQueryException>(() => new RDFSumAggregator(new RDFVariable("?AGGVAR"), null));

[TestMethod]
public void ShouldCreateDistinctSumAggregator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ public void ShouldApplySelectQueryOnGraphWithServicePatternGroupAndThrowExceptio

try
{
RDFSelectQueryResult result = query.ApplyToGraph(new RDFGraph());
_ = query.ApplyToGraph(new RDFGraph());
}
catch (RDFQueryException qex)
{
Expand Down Expand Up @@ -801,7 +801,7 @@ public void ShouldApplySelectQueryOnGraphWithServicePatternGroupAndThrowExceptio

try
{
RDFSelectQueryResult result = query.ApplyToGraph(new RDFGraph());
_ = query.ApplyToGraph(new RDFGraph());
}
catch (RDFQueryException qex)
{
Expand Down
6 changes: 3 additions & 3 deletions RDFSharp.Test/Query/Mirella/RDFQueryEngineTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ public void ShouldEvaluateSelectQueryOnFederationWithResults()
}

[TestMethod]
public void ShouldEvaluateSelectueryOnFederation_BindAndProjectionExpressions()
public void houldEvaluateSelectueryOnFederation_BindAndProjectionExpressions()
{
RDFGraph graph = new RDFGraph(
[
Expand Down Expand Up @@ -1605,7 +1605,7 @@ public void ShouldEvaluateSelectueryOnFederation_BindAndProjectionExpressions()
}

[TestMethod]
public void ShouldEvaluateSelectQeryOnFederationWithResults_SPARQLEndpoints()
public void SouldEvaluateSelectQeryOnFederationWithResultsSPARQLEndpoints()
{
string receivedQuery1 = "";
string receivedQuery2 = "";
Expand Down Expand Up @@ -1733,7 +1733,7 @@ public void ShouldEvaluateSelectQeryOnFederationWithResults_SPARQLEndpoints()
}

[TestMethod]
public void ShouldEvaluateSelectQuryOnFederationWithResults_SPARQLEndpointsOneGivingEmptyResult()
public void ShouldEvaluateSelectQuryOnFederationWithResultsSPARQLEndpointsOneGivingEmptyResult()
{
string receivedQuery1 = "";
string receivedQuery2 = "";
Expand Down

0 comments on commit 6f41083

Please sign in to comment.