private static CustomResultInterceptor CreateFailInterceptor() { var interceptorResult = InterceptorResult.Fail(Message); var interceptor = new CustomResultInterceptor(interceptorResult); return(interceptor); }
public async Task Send_WithFailInterceptor_ThrowsInterceptorFailException() { var client = new MockRequester(new ApiConfig { SendInterceptors = new [] { new CustomResultSendInterceptor(InterceptorResult.Fail("fail!")) } }, "send", null).CreateClient(); await Assert.ThrowsAsync <InterceptorFailException>(() => client.Send(6789, "address", FaucetPayClient.Bitcoin)); }
public void Fail_HasMessage() { var result = InterceptorResult.Fail(Message); Assert.Equal(Message, result.Message); }
public void Fail_HasSuccessFalse() { var result = InterceptorResult.Fail(Message); Assert.False(result.IsSuccess); }