I tried the below code but it is throwing exception
System.InvalidOperationException: Invalid call, the last call has been used or no call has been made (make sure that you are calling a virtual (C#) / Overridable (VB) method).
var mockHttpClient = MockRepository.GenerateStrictMock<HttpClient>();
HttpResponseMessage fakeResponse = FakeHttpResponseMessage(HttpStatusCode.OK);
HttpRequestMessage fakeMessage = FakeHttpRequestMessage();
mockHttpClient.Expect(x => x.SendAsync(fakeMessage)).IgnoreArguments().Return(Task.FromResult(fakeResponse));
Aucun commentaire:
Enregistrer un commentaire