2020-06-28 21:44:35 -05:00
|
|
|
using System;
|
2017-09-13 15:47:34 +09:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Text;
|
2020-06-28 17:55:27 +09:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2017-09-13 15:47:34 +09:00
|
|
|
using Microsoft.AspNetCore.Mvc.Routing;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Tests.Mocks
|
|
|
|
{
|
2017-10-27 17:53:04 +09:00
|
|
|
public class UrlHelperMock : IUrlHelper
|
|
|
|
{
|
|
|
|
Uri _BaseUrl;
|
|
|
|
public UrlHelperMock(Uri baseUrl)
|
|
|
|
{
|
|
|
|
_BaseUrl = baseUrl;
|
|
|
|
}
|
|
|
|
public ActionContext ActionContext => throw new NotImplementedException();
|
2017-09-13 15:47:34 +09:00
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public string Action(UrlActionContext actionContext)
|
|
|
|
{
|
|
|
|
return $"{_BaseUrl}mock";
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public string Content(string contentPath)
|
|
|
|
{
|
|
|
|
return $"{_BaseUrl}{contentPath}";
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public bool IsLocalUrl(string url)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public string Link(string routeName, object values)
|
|
|
|
{
|
|
|
|
return _BaseUrl.AbsoluteUri;
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
public string RouteUrl(UrlRouteContext routeContext)
|
|
|
|
{
|
|
|
|
return _BaseUrl.AbsoluteUri;
|
|
|
|
}
|
|
|
|
}
|
2017-09-13 15:47:34 +09:00
|
|
|
}
|