Skip to content

Commit

Permalink
Tests for Call
Browse files Browse the repository at this point in the history
  • Loading branch information
aensidhe committed Sep 21, 2018
1 parent b71ae2a commit d5a81b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tarantool/testdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function return_tuple()
return { 1, 2 }
end


function return_array()
log.info('return_array called')
return {{ "abc", "def" }}
Expand All @@ -167,6 +166,10 @@ function return_nothing()
log.info('return_nothing called')
end

function replace(t)
return box.space.with_scalar_index:replace(t)
end

local truncate_space = function(name)
local space = box.space[name]

Expand Down
17 changes: 17 additions & 0 deletions tests/progaudi.tarantool.tests/Box/Call_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,22 @@ public async Task return_nothing_should_not_throw()
Should.NotThrow(async () => await tarantoolClient.Call("return_nothing"));
}
}

[Fact]
public async Task replace_via_call()
{
using (var tarantoolClient = await Client.Box.Connect(ConnectionStringFactory.GetReplicationSource_1_8()))
{
var tuple = ("123", new byte[] { 1, 2, 3 });
var result = await tarantoolClient.Call<ValueTuple<string, byte[]>[], ValueTuple<string, byte[]>>(
"replace",
new [] { tuple });

var firstTuple = result.Data[0];

tuple.Item1.ShouldBe(firstTuple.Item1);
tuple.Item2.ShouldBe(firstTuple.Item2);
}
}
}
}

0 comments on commit d5a81b1

Please sign in to comment.