public void PathBase_Added(string startValue, string pathBase, bool append, string expected) { var httpContext = new DefaultHttpContext(); httpContext.Request.PathBase = string.IsNullOrEmpty(pathBase) ? new PathString() : new PathString(pathBase); var transform = new RequestHeaderXForwardedPathBaseTransform(append); var result = transform.Apply(httpContext, new HttpRequestMessage(), startValue.Split(";", System.StringSplitOptions.RemoveEmptyEntries)); Assert.Equal(expected.Split(";", System.StringSplitOptions.RemoveEmptyEntries), result); }