public void GetErrorDetailsDataType_WhenErrorIsNull_CallsBase() { using (var rpc = new TestJsonRpc()) { Type type = rpc.GetErrorDetailsDataTypeHelper(error: null); Assert.Equal(typeof(CommonErrorData), type); } }
public void GetErrorDetailsDataType_WhenErrorIsNull_CallsBase() { using (var rpc = new TestJsonRpc()) { #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. Type?type = rpc.GetErrorDetailsDataTypeHelper(error: null); #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. Assert.Equal(typeof(CommonErrorData), type); } }
public void GetErrorDetailsDataType_WhenErrorPropertyIsNull_CallsBase() { using (var rpc = new TestJsonRpc()) { Type?type = rpc.GetErrorDetailsDataTypeHelper( new JsonRpcError() { Error = null }); Assert.Equal(typeof(CommonErrorData), type); } }
public void GetErrorDetailsDataType_WhenErrorCodePropertyIsAMatch_ReturnsRemoteErrorType() { using (var rpc = new TestJsonRpc()) { Type?type = rpc.GetErrorDetailsDataTypeHelper( new JsonRpcError() { Error = new JsonRpcError.ErrorDetail() { Code = (JsonRpcErrorCode)(int)RemoteErrorCode.RemoteError } }); Assert.Equal(typeof(RemoteError), type); } }
public void GetErrorDetailsDataType_WhenErrorCodePropertyIsNotAMatch_CallsBase() { using (var rpc = new TestJsonRpc()) { Type?type = rpc.GetErrorDetailsDataTypeHelper( new JsonRpcError() { Error = new JsonRpcError.ErrorDetail() { Code = (JsonRpcErrorCode)int.MinValue } }); Assert.Equal(typeof(CommonErrorData), type); } }