Skip to content

Commit 8e84962

Browse files
committed
Fix unit tests running in release configuration
1 parent 3b6906f commit 8e84962

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Aria2.JsonRpcClient.Test/JsonRpcErrorTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ public void GIVEN_ValidJson_WHEN_DeserializingJsonRpcError_THEN_ShouldReturnCorr
2525
error.Should().NotBeNull();
2626
error.Code.Should().Be(-32600);
2727
error.Message.Should().Be("Invalid Request");
28+
#if DEBUG
2829
error.ExtensionData.Should().ContainKey("customKey");
2930
error.ExtensionData["customKey"].GetString().Should().Be("customValue");
31+
#endif
3032
}
3133
}
3234
}

Aria2.JsonRpcClient.Test/JsonRpcResponseTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ public void GIVEN_ValidJson_WHEN_DeserializingJsonRpcResponse_THEN_ShouldReturnC
2626
response.JsonRpc.Should().Be("2.0");
2727
response.Id.Should().Be("testId");
2828
response.Error.Should().NotBeNull();
29+
#if DEBUG
2930
response.ExtensionData.Should().ContainKey("customKey");
3031
response.ExtensionData["customKey"].GetString().Should().Be("customValue");
32+
#endif
3133
}
3234

3335
[Fact]
@@ -51,8 +53,10 @@ public void GIVEN_ValidJson_WHEN_DeserializingGenericJsonRpcResponse_THEN_Should
5153
response.JsonRpc.Should().Be("2.0");
5254
response.Id.Should().Be("testId");
5355
response.Result.Should().Be("someResult");
56+
#if DEBUG
5457
response.ExtensionData.Should().ContainKey("anotherKey");
5558
response.ExtensionData["anotherKey"].GetString().Should().Be("anotherValue");
59+
#endif
5660
}
5761
}
5862
}

0 commit comments

Comments
 (0)