From 395924caeebaad91de25188ce7da523a34a3a702 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Wed, 10 Jan 2024 11:35:36 +0100 Subject: [PATCH] chore: add tests --- Client.Test/Internal/FlightSqlClientTest.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Client.Test/Internal/FlightSqlClientTest.cs b/Client.Test/Internal/FlightSqlClientTest.cs index ef5e2a0..ac0c575 100644 --- a/Client.Test/Internal/FlightSqlClientTest.cs +++ b/Client.Test/Internal/FlightSqlClientTest.cs @@ -52,22 +52,25 @@ public void PrepareFlightTicket() public void PrepareFlightTicketNamedParameters() { var prepareFlightTicket = _flightSqlClient.PrepareFlightTicket( - "select * from cpu where location = $location", + "select * from cpu where location = $location and production = $production and count = $count and temperature = $temperature", "my-db", QueryType.SQL, new Dictionary { - { "location", "us" } + { "location", "us" }, + { "production", true }, + { "count", 10 }, + { "temperature", 23.5 } }); - const string ticket = - @"{""database"":""my-db"",""sql_query"":""select * from cpu where location = $location"",""query_type"":""sql"",""params"": {""location"":""us""}}"; + var ticket = "{\"database\":\"my-db\"," + + "\"sql_query\":\"select * from cpu where location = $location and production = $production and count = $count and temperature = $temperature\"," + + "\"query_type\":\"sql\"," + + "\"params\": {\"location\":\"us\",\"production\":true,\"count\":10,\"temperature\":23.5}}"; Assert.Multiple(() => { Assert.That(prepareFlightTicket, Is.Not.Null); - var actual = Encoding.UTF8.GetString(prepareFlightTicket.Ticket.ToByteArray()); - Console.WriteLine(actual); - Assert.That(actual, Is.EqualTo(ticket)); + Assert.That(Encoding.UTF8.GetString(prepareFlightTicket.Ticket.ToByteArray()), Is.EqualTo(ticket)); }); } } \ No newline at end of file