public void SendRequest_NullInput_ReturnFalse() { IHttpClientWrapper httpClientWrapper = MockRepository.GenerateStub <IHttpClientWrapper>(); OptimizedTarget target = new OptimizedTarget(httpClientWrapper, null); bool nullInputResult = target.SendRequest(null, out string _); Assert.IsFalse(nullInputResult); }
public void SendRequest_HttpClientFailed_ReturnFalse() { IHttpClientWrapper httpClientWrapper = MockRepository.GenerateStub <IHttpClientWrapper>(); httpClientWrapper.Stub(s => s.SendRequest(null, out string _)).IgnoreArguments().Return(false); OptimizedTarget target = new OptimizedTarget(httpClientWrapper, null); bool nullInputResult = target.SendRequest(new HttpRequestMessage(), out string _); Assert.IsFalse(nullInputResult); }
public void SendRequest_HttpClientThrowException_ReturnFalse() { IHttpClientWrapper httpClientWrapper = MockRepository.GenerateStub <IHttpClientWrapper>(); httpClientWrapper.Stub(s => s.SendRequest(null, out string _)).IgnoreArguments().Throw(new Exception()); OptimizedTarget target = new OptimizedTarget(httpClientWrapper, null); bool throwExceptionResult = target.SendRequest(new HttpRequestMessage(), out string _); Assert.IsFalse(throwExceptionResult); }