public void getVehicle(MockRequest request) { var key = GenerateKey(request); if (blackHouse.CheckInBlack(key)) { return; } var response = Call(request.Url); if (!response.IsSuccessStatusCode) { if (response.StatusCode == HttpStatusCode.Unauthorized) { RefreshToken(); } blackHouse.Handle(key, request); } else { blackHouse.Remove(key); } }
public void Add(string key, MockRequest child) { children.Add(key, child); }
private static string GenerateKey(MockRequest request) { return(request.Method + request.Url); }