From 02d9129eaf14fd81ecb6b1d706d4c4caa0d2ea84 Mon Sep 17 00:00:00 2001 From: schwartz-concordium <132270889+schwartz-concordium@users.noreply.github.com> Date: Fri, 26 Jan 2024 11:59:45 +0100 Subject: [PATCH] Added test for errors --- rust-bindings/src/lib.rs | 2 +- tests/UnitTests/Interop/InteropBindingTests.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rust-bindings/src/lib.rs b/rust-bindings/src/lib.rs index 3556c15a..d788a683 100644 --- a/rust-bindings/src/lib.rs +++ b/rust-bindings/src/lib.rs @@ -198,7 +198,7 @@ fn schema_display_aux(schema: &[u8], schema_version: Option) -> Result() - .Where(e => e.Result == Result.VersionedSchemaErrorParseError); + .Where(e => + e.Result == Result.VersionedSchemaErrorParseError && + e.Message.Equals("Parse error", StringComparison.Ordinal)); } [Fact] @@ -101,7 +103,9 @@ public async Task GivenBadReceiveParam_WhenDisplayReceiveParam_ThenThrowExceptio // Assert action.Should().Throw() - .Where(e => e.Result == Result.NoError); + .Where(e => + e.Result == Result.JsonError && + e.Message.StartsWith("Failed to deserialize AccountAddress due to: Could not parse AccountAddress")); } [Fact]