@mass-dot-net:
Resolving the Cookies problem just requires creating your own implementation of HttpCookies that you can instantiate:
public class FakeHttpCookies : HttpCookies
{
public override void Append(string name, string value)
{
throw new NotImplementedException();
}
public override void Append(IHttpCookie cookie)
{
throw new NotImplementedException();
}
public override IHttpCookie CreateNew()
{
throw new NotImplementedException();
}
}
Now you can set the value in the MockHttpResponseData
constructor:
public MockHttpResponseData(FunctionContext functionContext, HttpCookies? cookies = null) : base(functionContext)
{
Cookies = cookies ?? new FakeHttpCookies();
}