public static void QueryStringWithFields_GuardClauses() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.QueryString <Sample>(null, "", new[] { "one", "two" })); Assert.Throws <ArgumentNullException>(() => fakeSample.QueryString(null, new[] { "one", "two" })); Assert.Throws <ArgumentOutOfRangeException>(() => fakeSample.QueryString("hi", null)); Assert.Throws <ArgumentOutOfRangeException>(() => fakeSample.QueryString("hi", new string[] { })); }
public void QueryString_GuardClauses() { var source = new FakeQueryProvider().CreateQuery <Sample>(); Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.QueryString <Sample>(null, "")); Assert.Throws <ArgumentNullException>(() => source.QueryString(null)); }
public void QueryStringWithFields_GuardClauses() { var source = new FakeQueryProvider().CreateQuery <Sample>(); Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.QueryString <Sample>(null, "", new[] { "one", "two" })); Assert.Throws <ArgumentNullException>(() => source.QueryString(null, new[] { "one", "two" })); Assert.Throws <ArgumentOutOfRangeException>(() => source.QueryString("hi", null)); Assert.Throws <ArgumentOutOfRangeException>(() => source.QueryString("hi", new string[] { })); }
[ExcludeFromCodeCoverage] // Expression isn't "executed" public void ThenByScoreThrowArgumentNullExceptionIfSourceIsNull() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.ThenByScore <Sample>(null)); }
[ExcludeFromCodeCoverage] // Expression isn't "executed" public void OrderByScoreDescendingThrowArgumentNullExceptionIfSourceIsNull() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.OrderByScoreDescending <Sample>(null)); }
public void OrderByScore_GuardClauses() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.OrderByScore <Sample>(null)); }
public static void QueryString_GuardClauses() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.QueryString <Sample>(null, "")); Assert.Throws <ArgumentNullException>(() => fakeSample.QueryString(null)); }
public static void HighlightQuery_Throws() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.Highlight <Sample, string>(null, null)); Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.Highlight <Sample, string>(null, e => e.Property)); Assert.Throws <NotSupportedException>(() => testableSample.Highlight(e => e.Property.Equals("").ToString()).ToList()); }
public static void ThenByScoreDescending_GuardClauses() { Assert.Throws <ArgumentNullException>(() => ElasticQueryExtensions.ThenByScoreDescending <Sample>(null)); }