btcpayserver/BTCPayServer.Tests/Mocks/UrlHelperMock.cs

42 lines
963 B
C#
Raw Normal View History

2020-06-28 21:44:35 -05:00
using System;
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
{
public class UrlHelperMock : IUrlHelper
{
readonly Uri _BaseUrl;
public UrlHelperMock(Uri baseUrl)
{
_BaseUrl = baseUrl;
}
public ActionContext ActionContext => throw new NotImplementedException();
2017-09-13 15:47:34 +09:00
public string Action(UrlActionContext actionContext)
{
return $"{_BaseUrl}mock";
}
2017-09-13 15:47:34 +09:00
public string Content(string contentPath)
{
return $"{_BaseUrl}{contentPath}";
}
2017-09-13 15:47:34 +09:00
public bool IsLocalUrl(string url)
{
return false;
}
2017-09-13 15:47:34 +09:00
public string Link(string routeName, object values)
{
return _BaseUrl.AbsoluteUri;
}
2017-09-13 15:47:34 +09:00
public string RouteUrl(UrlRouteContext routeContext)
{
return _BaseUrl.AbsoluteUri;
}
}
2017-09-13 15:47:34 +09:00
}