public void GetVirtualPath_AppRelativeTemplateSourceDirectory_Null()
        {
            var controlStub = new WebButton();

            controlStub.ID = "ControlID";
            controlStub.AppRelativeTemplateSourceDirectory = null;
            Assert.That(() => VirtualPathUtility.GetVirtualPath(controlStub, "../relative/file.txt"), Throws.InvalidOperationException);
        }
        public void GetVirtualPath_AppRelativeTemplateSourceDirectory_Empty()
        {
            var controlStub = new WebButton();

            controlStub.ID = "ControlID";
            controlStub.AppRelativeTemplateSourceDirectory = "";
            Assert.That(
                () => VirtualPathUtility.GetVirtualPath(controlStub, "../relative/file.txt"),
                Throws.InvalidOperationException
                .And.Message.StartsWith("The 'AppRelativeTemplateSourceDirectory' property of the WebButton 'ControlID' is not set."));
        }
        private ISearchAvailableObjectWebService GetSearchAvailableObjectService()
        {
            if (IsDesignMode)
            {
                return(null);
            }

            if (string.IsNullOrEmpty(SearchServicePath))
            {
                throw new InvalidOperationException(string.Format("BocAutoCompleteReferenceValue '{0}' does not have a SearchServicePath set.", ID));
            }

            var virtualServicePath = VirtualPathUtility.GetVirtualPath(this, SearchServicePath);

            return(WebServiceFactory.CreateJsonService <ISearchAvailableObjectWebService> (virtualServicePath));
        }
Пример #4
0
        private void CheckIconService()
        {
            if (IsDesignMode)
            {
                return;
            }

            if (string.IsNullOrEmpty(IconServicePath))
            {
                return;
            }

            var virtualServicePath = VirtualPathUtility.GetVirtualPath(this, IconServicePath);

            WebServiceFactory.CreateJsonService <IBusinessObjectIconWebService> (virtualServicePath);
        }
 public void GetVirtualPath_HierchyPath()
 {
     Assert.That(VirtualPathUtility.GetVirtualPath(_controlStub, "../relative/file.txt"), Is.EqualTo("~/base/relative/file.txt"));
 }
 public void GetVirtualPath_FilePath()
 {
     Assert.That(VirtualPathUtility.GetVirtualPath(_controlStub, "file.txt"), Is.EqualTo("~/base/Path/file.txt"));
 }
 public void GetVirtualPath_VirtualPath()
 {
     Assert.That(VirtualPathUtility.GetVirtualPath(_controlStub, "~/virtual/path/file.txt"), Is.EqualTo("~/virtual/path/file.txt"));
 }