-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hi!
When i tried to use this library, i found some intresting issue: when i call a handler, it invokes twice.
This problem reproduces when i make a call with Fiddler, Postman or by Opera browser.
Sources of test:
using System;
using System.Threading;
using HttpMock;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var delaySeconds = TimeSpan.FromSeconds(2);
var serverAddr = "http://localhost:9191";
var apiPath = "/profileImporter/invoke";
var url = serverAddr + apiPath;
Console.WriteLine($"{nameof(url)} : {url}");
var mockApi = HttpMockRepository.At(serverAddr);
mockApi.Stub(x => x.Get("")).Return(() =>
{
Console.WriteLine($"{DateTime.Now:yyyyMMdd HH:mm:ss} - server called");
Console.WriteLine($"Delay: {delaySeconds}");
Thread.Sleep(delaySeconds);
Console.WriteLine($"{DateTime.Now:yyyyMMdd HH:mm:ss} - delay ended");
Console.WriteLine();
Console.WriteLine();
return "TEST_GET_RESULT";
}).OK();
Console.WriteLine("Press any key to exit this shit...");
Console.ReadKey();
}
}
}
Metadata
Metadata
Assignees
Labels
No labels
