Skip to content

Commit

Permalink
Merge pull request #58 from kendaleiv/fix-test-warnings
Browse files Browse the repository at this point in the history
Fix test warnings
  • Loading branch information
khalidabuhakmeh authored Sep 25, 2018
2 parents 614f2a9 + 8b89400 commit 9fbdda2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void Can_query_using_single_value()
q => q.Filter(new { Name = new[] { "camaro" } })));

Assert.NotNull(results);
Assert.Equal(1, results.Hits.Count());
Assert.Single(results.Hits);
Assert.Equal("Camaro", results.Hits.First().Source.Name);
}
}
Expand All @@ -86,7 +86,7 @@ public void Multiple_filter_properties_queried_as_collection_of_and_operators()
q => q.Filter(new { Name = new[] { "camaro", "monte carlo" }, Year = 2016 })));

Assert.NotNull(noResults);
Assert.Equal(0, noResults.Hits.Count());
Assert.Empty(noResults.Hits);

var twoResults = elasticClient
.Search<Car>(x => x.Index("vehicles")
Expand Down Expand Up @@ -168,7 +168,7 @@ public void Nullable_boolean_true_returns_expected_results()
q => q.Filter(new { IsElectric = true })));

Assert.NotNull(results);
Assert.Equal(1, results.Hits.Count());
Assert.Single(results.Hits);
Assert.Equal("Volt", results.Hits.First().Source.Name);
}
}
Expand All @@ -192,10 +192,10 @@ public void Nullable_boolean_false_returns_expected_results()
q => q.Filter(new { IsElectric = false })));

Assert.NotNull(results);
Assert.Equal(1, results.Hits.Count());
Assert.Single(results.Hits);
Assert.Equal("Camaro", results.Hits.First().Source.Name);
}
}
}
}
}
}
8 changes: 4 additions & 4 deletions tests/Filter.Nest.Tests/SearchDescriptorExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void Can_query_using_single_value()
.PostFilter(new { Name = "camaro" }));

Assert.NotNull(results);
Assert.Equal(1, results.Hits.Count());
Assert.Single(results.Hits);
Assert.Equal("Camaro", results.Hits.First().Source.Name);
}
}
Expand All @@ -86,7 +86,7 @@ public void Multiple_filter_properties_queried_as_collection_of_and_operators()
.PostFilter(new { Name = new[] { "camaro", "monte carlo" }, Year = 2016 }));

Assert.NotNull(noResults);
Assert.Equal(0, noResults.Hits.Count());
Assert.Empty(noResults.Hits);

var twoResults = elasticClient
.Search<Car>(x => x.Index("vehicles")
Expand Down Expand Up @@ -171,7 +171,7 @@ public void Nullable_boolean_true_returns_expected_results()
.PostFilter(new { IsElectric = true }));

Assert.NotNull(results);
Assert.Equal(1, results.Hits.Count());
Assert.Single(results.Hits);
Assert.Equal("Volt", results.Hits.First().Source.Name);
}
}
Expand All @@ -196,7 +196,7 @@ public void Nullable_boolean_false_returns_expected_results()
.PostFilter(new { IsElectric = false }));

Assert.NotNull(results);
Assert.Equal(1, results.Hits.Count());
Assert.Single(results.Hits);
Assert.Equal("Camaro", results.Hits.First().Source.Name);
}
}
Expand Down
52 changes: 26 additions & 26 deletions tests/Filter.Tests/Generic/IEnumerable`1ExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void Should_filter_multiple_properties()
});

Assert.NotNull(@return);
Assert.Equal(0, @return.Count());
Assert.Empty(@return);
}

[Fact]
Expand Down Expand Up @@ -123,7 +123,7 @@ public void Should_filter_on_nullable_booleans()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("Tim", @return.First().FirstName);
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ public void Should_filter_when_property_types_match_as_enumerable_string()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -164,7 +164,7 @@ public void Should_filter_when_property_types_match_as_enumerable_integer()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -176,7 +176,7 @@ public void Should_be_able_to_handle_nullable_destination_and_primitive_filter()
Rating = new[] { 4.5m }
});

Assert.Equal(1, @return.Count());
Assert.Single(@return);
}

[Fact]
Expand All @@ -187,7 +187,7 @@ public void Should_be_able_to_handle_nullable_destination_and_nullable_primitive
Rating = new decimal?[] { 4.5m }
});

Assert.Equal(1, @return.Count());
Assert.Single(@return);
}

[Fact]
Expand All @@ -198,7 +198,7 @@ public void Should_be_able_to_handle_nullable_destination_and_nullable_primitive
Rating = new decimal?(4.5m)
});

Assert.Equal(1, @return.Count());
Assert.Single(@return);
}

[Fact]
Expand All @@ -212,7 +212,7 @@ public void Should_be_able_to_handle_nullable_source()
Rating = new decimal?[] { 4.5m }
});

Assert.Equal(0, @return.Count());
Assert.Empty(@return);
}
}

Expand All @@ -229,7 +229,7 @@ public void Should_filter_open_ended_lower_bound(string value)
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -244,7 +244,7 @@ public void Should_filter_open_ended_upper_bound(string value)
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("Tim", @return.First().FirstName);
}

Expand All @@ -263,7 +263,7 @@ public void Should_filter_for_concrete_range()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -276,7 +276,7 @@ public void Should_filter_when_property_types_match_as_range_byte()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -289,7 +289,7 @@ public void Should_filter_when_property_types_match_as_range_char()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -302,7 +302,7 @@ public void Should_filter_when_property_types_match_as_range_datetime()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -315,7 +315,7 @@ public void Should_filter_when_property_types_match_as_range_datetimeoffset()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -328,7 +328,7 @@ public void Should_filter_when_property_types_match_as_range_decimal()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -341,7 +341,7 @@ public void Should_filter_when_property_types_match_as_range_double()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -354,7 +354,7 @@ public void Should_filter_when_property_types_match_as_range_float()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -367,7 +367,7 @@ public void Should_filter_when_property_types_match_as_range_int()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -380,7 +380,7 @@ public void Should_filter_when_property_types_match_as_range_long()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -393,7 +393,7 @@ public void Should_filter_when_property_types_match_as_range_sbyte()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -406,7 +406,7 @@ public void Should_filter_when_property_types_match_as_range_short()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -419,7 +419,7 @@ public void Should_filter_when_property_types_match_as_range_uint()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -432,7 +432,7 @@ public void Should_filter_when_property_types_match_as_range_ulong()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -445,7 +445,7 @@ public void Should_filter_when_property_types_match_as_range_ushort()
});

Assert.NotNull(@return);
Assert.Equal(1, @return.Count());
Assert.Single(@return);
Assert.Equal("John", @return.First().FirstName);
}

Expand All @@ -457,7 +457,7 @@ public void Should_be_able_to_handle_nullable_source()
Rating = (Range<decimal>)"[4.5,5.0]"
});

Assert.Equal(1, @return.Count());
Assert.Single(@return);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Filter.Tests/Generic/IQueryable`1ExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void Should_be_able_to_handle_nullable_source()
Rating = new decimal?[] { 4.5m }
});

Assert.Equal(0, @return.Count());
Assert.Empty(@return);
}
}

Expand Down

0 comments on commit 9fbdda2

Please sign in to comment.