Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Commit

Permalink
For #15
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
TrevorPilley committed Nov 13, 2020
1 parent f4b4869 commit 03feedf
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions Net.Http.OData.Tests/Query/QueryableExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,7 @@ public QueryableExtensionsTests()
}

[Fact]
public void Apply_Throws_ArgumentNullException_For_Null_Queryable()
{
TestHelper.EnsureEDM();

var queryOptions = new ODataQueryOptions(
"?$count=true",
EntityDataModel.Current.EntitySets["Customers"],
Mock.Of<IODataQueryOptionsValidator>());

Assert.Throws<ArgumentNullException>(() => QueryableExtensions.Apply(null, queryOptions));
}

[Fact]
public void Apply_Throws_ArgumentNullException_For_Null_QueryOptions()
=> Assert.Throws<ArgumentNullException>(() => QueryableExtensions.Apply(_categories.AsQueryable(), null));

[Fact]
public void ApplyTo_OrderBy_NotDeclared()
public void Apply_OrderBy_NotDeclared()
{
TestHelper.EnsureEDM();

Expand All @@ -97,7 +80,7 @@ public void ApplyTo_OrderBy_NotDeclared()
}

[Fact]
public void ApplyTo_OrderBy_Properties()
public void Apply_OrderBy_Properties()
{
TestHelper.EnsureEDM();

Expand All @@ -117,7 +100,7 @@ public void ApplyTo_OrderBy_Properties()
}

[Fact]
public void ApplyTo_OrderBy_Properties_IncludingPropertyPath()
public void Apply_OrderBy_Properties_IncludingPropertyPath()
{
TestHelper.EnsureEDM();

Expand All @@ -137,7 +120,7 @@ public void ApplyTo_OrderBy_Properties_IncludingPropertyPath()
}

[Fact]
public void ApplyTo_OrderBy_SingleProperty_Ascending()
public void Apply_OrderBy_SingleProperty_Ascending()
{
TestHelper.EnsureEDM();

Expand All @@ -154,7 +137,7 @@ public void ApplyTo_OrderBy_SingleProperty_Ascending()
}

[Fact]
public void ApplyTo_OrderBy_SingleProperty_Descending()
public void Apply_OrderBy_SingleProperty_Descending()
{
TestHelper.EnsureEDM();

Expand All @@ -171,7 +154,7 @@ public void ApplyTo_OrderBy_SingleProperty_Descending()
}

[Fact]
public void ApplyTo_Select_Expand()
public void Apply_Select_Expand()
{
TestHelper.EnsureEDM();

Expand Down Expand Up @@ -213,7 +196,7 @@ public void ApplyTo_Select_Expand()
}

[Fact]
public void ApplyTo_Select_NotDeclared()
public void Apply_Select_NotDeclared()
{
TestHelper.EnsureEDM();

Expand Down Expand Up @@ -241,7 +224,7 @@ public void ApplyTo_Select_NotDeclared()
}

[Fact]
public void ApplyTo_Select_Properties()
public void Apply_Select_Properties()
{
TestHelper.EnsureEDM();

Expand All @@ -264,7 +247,7 @@ public void ApplyTo_Select_Properties()
}

[Fact]
public void ApplyTo_Select_Properties_IncludingPropertyPath()
public void Apply_Select_Properties_IncludingPropertyPath()
{
TestHelper.EnsureEDM();

Expand All @@ -291,7 +274,7 @@ public void ApplyTo_Select_Properties_IncludingPropertyPath()
}

[Fact]
public void ApplyTo_Select_SingleProperty()
public void Apply_Select_SingleProperty()
{
TestHelper.EnsureEDM();

Expand All @@ -312,7 +295,7 @@ public void ApplyTo_Select_SingleProperty()
}

[Fact]
public void ApplyTo_Select_Star()
public void Apply_Select_Star()
{
TestHelper.EnsureEDM();

Expand Down Expand Up @@ -340,7 +323,7 @@ public void ApplyTo_Select_Star()
}

[Fact]
public void ApplyTo_Skip()
public void Apply_Skip()
{
TestHelper.EnsureEDM();

Expand All @@ -359,7 +342,24 @@ public void ApplyTo_Skip()
}

[Fact]
public void ApplyTo_Throws_InvalidOperationException_For_Incorrect_QueryType()
public void Apply_Throws_ArgumentNullException_For_Null_Queryable()
{
TestHelper.EnsureEDM();

var queryOptions = new ODataQueryOptions(
"?$count=true",
EntityDataModel.Current.EntitySets["Customers"],
Mock.Of<IODataQueryOptionsValidator>());

Assert.Throws<ArgumentNullException>(() => QueryableExtensions.Apply(null, queryOptions));
}

[Fact]
public void Apply_Throws_ArgumentNullException_For_Null_QueryOptions()
=> Assert.Throws<ArgumentNullException>(() => QueryableExtensions.Apply(_categories.AsQueryable(), null));

[Fact]
public void Apply_Throws_InvalidOperationException_For_Incorrect_QueryType()
{
TestHelper.EnsureEDM();

Expand All @@ -372,7 +372,7 @@ public void ApplyTo_Throws_InvalidOperationException_For_Incorrect_QueryType()
}

[Fact]
public void ApplyTo_Top()
public void Apply_Top()
{
TestHelper.EnsureEDM();

Expand Down

0 comments on commit 03feedf

Please sign in to comment.