public void Get_from_db_null_value()
        {
            IDebugBridge debugBridge = Substitute.For <IDebugBridge>();

            byte[] key = new byte[] { 1, 2, 3 };
            debugBridge.GetDbValue(Arg.Any <string>(), Arg.Any <byte[]>()).Returns((byte[])null);

            IConfigProvider     configProvider = Substitute.For <IConfigProvider>();
            IJsonRpcModelMapper modelMapper    = new JsonRpcModelMapper();
            DebugModule         module         = new DebugModule(configProvider, NullLogManager.Instance, debugBridge, modelMapper, new UnforgivingJsonSerializer());
            JsonRpcResponse     response       = RpcTest.TestRequest <IDebugModule>(module, "debug_getFromDb", "STATE", key.ToHexString());

            Assert.IsNull(response.Error, "error");
            Assert.IsNull(response.Result, "result");
        }
        public void Get_from_db()
        {
            IDebugBridge debugBridge = Substitute.For <IDebugBridge>();

            byte[] key   = new byte[] { 1, 2, 3 };
            byte[] value = new byte[] { 4, 5, 6 };
            debugBridge.GetDbValue(Arg.Any <string>(), Arg.Any <byte[]>()).Returns(value);

            IConfigProvider     configProvider = Substitute.For <IConfigProvider>();
            IJsonRpcModelMapper modelMapper    = new JsonRpcModelMapper();
            DebugModule         module         = new DebugModule(configProvider, NullLogManager.Instance, debugBridge, modelMapper, new UnforgivingJsonSerializer());
            JsonRpcResponse     response       = RpcTest.TestRequest <IDebugModule>(module, "debug_getFromDb", "STATE", key.ToHexString());

            byte[] result = Bytes.FromHexString((string)response.Result);
            Assert.AreEqual(value, result);
        }