/// <summary> /// Initializes a new instance of the <see cref="PhunFileSystem" /> class. /// </summary> /// <param name="api">The API.</param> /// <param name="connector">The connector.</param> /// <param name="context">The context.</param> public PhunFileSystem(IPhunApi api, IContentConnector connector) { this.connector = connector; this.api = api; this.config = Bootstrapper.Default.Config; this.myUtility = new ResourcePathUtility(); }
public void TestGetCurrentTenantSupportMultiTenantForTwoLevelDomain() { // Arrange var cc = new ResourcePathUtility(); var config = new Mock<ICmsConfiguration>(); config.Setup(cf => cf.DomainLevel).Returns(2); cc.Config = config.Object; // Act var result = cc.GetTenantHost(new Uri("http://www.youbet.cha.com/blah")); // Assert Assert.AreEqual("cha.com", result); }
public void TestRenderBundlesDoesNotRenderEditorInitialize() { // Arrange var rvf = new ResourcePathUtility(); rvf.Config = new PhunCmsConfigurationSection() { ResourceRoute = "BogusRoute" }; var expected = @"<script type=""text/javascript"" src=""/BogusRoute/scripts/jquery.js""></script>"; // Act var result = rvf.PhunCmsRenderBundles(includeEditorInit: false); // Assert Assert.IsTrue(result.Contains(expected)); Assert.IsFalse(result.Contains("PhunCms.initEditor()")); }
/// <summary> /// Initializes a new instance of the <see cref="PhunApi" /> class. /// </summary> /// <param name="httpContext">The HTTP context.</param> /// <param name="connector">The connector.</param> public PhunApi(HttpContextBase httpContext, IContentConnector connector) { this.utility = new ResourcePathUtility(); this.connector = connector; this.host = this.utility.GetTenantHost(httpContext.Request.Url); this.request = new PhunRequest(httpContext); this.response = new PhunResponse(httpContext); this.phunFileSystem = new PhunFileSystem(this, connector); this.phunPath = new PhunPath(); this.user = httpContext.User; this.cache = new PhunCache(httpContext); this.trace = new Trace(); this.templateCache = new TemplateCache(this, httpContext); }
/// <summary> /// Initializes a new instance of the <see cref="TemplateHandler"/> class. /// </summary> public TemplateHandler() { this.Utility = new ResourcePathUtility(); }
public void TestRenderBundlesWithNoParametersReturnValidPath() { // Arrange var rvf = new ResourcePathUtility(); rvf.Config = new PhunCmsConfigurationSection() { ResourceRoute = "BogusRoute" }; var expected = @"<script type=""text/javascript"" src=""/BogusRoute/scripts/jquery.js""></script>"; // Act var result = rvf.PhunCmsRenderBundles(); // Assert Assert.IsTrue(result.Contains(expected)); Assert.IsTrue(result.Contains("PhunCms.initEditor()")); }