We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e3d2ae commit e772e29Copy full SHA for e772e29
QueryBuilder.Tests/AggregateTests.cs
@@ -1,11 +1,18 @@
1
using SqlKata.Compilers;
2
using SqlKata.Tests.Infrastructure;
3
+using System;
4
using Xunit;
5
6
namespace SqlKata.Tests
7
{
8
public class AggregateTests : TestSupport
9
10
+ [Fact]
11
+ public void AsAggregateEmpty()
12
+ {
13
+ Assert.Throws<ArgumentException>(() => new Query("A").AsAggregate("aggregate", new string[] { }));
14
+ }
15
+
16
[Fact]
17
public void Count()
18
QueryBuilder/Query.Aggregate.cs
@@ -7,6 +7,10 @@ public partial class Query
public Query AsAggregate(string type, string[] columns = null)
+ if (columns.Count() == 0)
+ throw new System.ArgumentException("Cannot aggregate without columns");
Method = "aggregate";
0 commit comments