Tests: Add PageCommon tests

This commit is contained in:
2023-05-29 03:27:24 +02:00
parent 2fd6cc5d1d
commit b8ab4766d4
7 changed files with 73 additions and 6 deletions

View File

@@ -41,7 +41,8 @@ public class FakeWebContext : IWebContext
public void ResponseRedirect(string url)
{
throw new NotImplementedException();
ResponseStatusCode = 302;
SetResponseHeader("location", url);
}
public void AddResponseCookie(string cookieName, string value, DateTime? expiration = null)
@@ -55,14 +56,16 @@ public class FakeWebContext : IWebContext
}
public bool ResponseHasStarted => false;
public int ResponseStatusCode { get; set; }
public int ResponseStatusCode { get; set; } = 200;
public string? ResponseContentType { get; set; }
public Dictionary<string, string> FakeResponseHeaders { get; } = new();
public void SetResponseHeader(string key, string value)
{
throw new NotImplementedException();
FakeResponseHeaders.Add(key, value);
}
public void PrepareCacheableResponse()