public void Test() { _buildManagerStub.Stub(stub => stub.GetCompiledType("~/VirtualServicePath")).Return(typeof(TestScriptService)); var service = _webServiceFactory.CreateJsonService <IValidJsonService> ("~/VirtualServicePath"); Assert.That(service, Is.InstanceOf <TestScriptService>()); }
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)); }