Skip to content

Commit 5a01d0c

Browse files
authored
chore(DRV-96): Added unit test to check that in case of an error function returns position parameters (#140)
1 parent 719656c commit 5a01d0c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

FaunaDB.Client.Test/ClientTest.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,17 @@ [Test] public async Task TestEvalDivideExpression()
10651065
Value res = await client.Query(Divide(100, 10));
10661066
Assert.AreEqual(10L, res.To<long>().Value);
10671067
}
1068+
1069+
[Test] public async Task TestEvalDivideExpressionWrongArgument()
1070+
{
1071+
var ex = Assert.ThrowsAsync<BadRequest>(
1072+
async() => await client.Query(Divide(Null(), 10))
1073+
);
1074+
1075+
AssertErrors(ex, code: "invalid argument", description: "Number expected, Null provided.");
1076+
AssertEmptyFailures(ex);
1077+
AssertPosition(ex, positions: Is.EquivalentTo(new List<string> { "divide", "0" }));
1078+
}
10681079

10691080
[Test] public async Task TestEvalModuloExpression()
10701081
{

0 commit comments

Comments
 (0)