示例#1
0
        public void EmptyStringThrows()
        {
            WebServiceCatalogModuleInfoStore store =
                mockContainer.Services.AddNew <WebServiceCatalogModuleInfoStore, IModuleInfoStore>();

            store.CatalogUrl = "";
        }
示例#2
0
        public void NullFileThrows()
        {
            WebServiceCatalogModuleInfoStore store =
                mockContainer.Services.AddNew <WebServiceCatalogModuleInfoStore, IModuleInfoStore>();

            store.CatalogUrl = null;
        }
        private void InitializeWebServiceCatalogModuleInfoStore()
        {
            IRoleService roleService = RootWorkItem.Services.Get <IRoleService>();
            WebServiceCatalogModuleInfoStore store =
                RootWorkItem.Services.Get <IModuleInfoStore>() as WebServiceCatalogModuleInfoStore;

            store.Roles = roleService.GetRolesForUser(Thread.CurrentPrincipal.Identity.Name);
        }
示例#4
0
        public void DefaultCatalogUrlIsCorrect()
        {
            WebServiceCatalogModuleInfoStore store =
                mockContainer.Services.AddNew <WebServiceCatalogModuleInfoStore, IModuleInfoStore>();

            Assert.AreEqual("http://localhost:54092/profilecatalogservices/profilecatalog.asmx",
                            store.CatalogUrl.ToLowerInvariant());
        }
示例#5
0
        public void ThrowExWhenWebServiceFails()
        {
            string filename = "http://localhost/unexisting/no.asmx";
            WebServiceCatalogModuleInfoStore store =
                mockContainer.Services.AddNew <WebServiceCatalogModuleInfoStore, IModuleInfoStore>();

            store.CatalogUrl = filename;
            store.Roles      = new string[] { "null" };
            string results = store.GetModuleListXml();

            Assert.IsNull(results);
        }
示例#6
0
        public void RequestCatalogContentsFromWebServiceAsString()
        {
            string contents = "<SolutionProfile xmlns=\"http://schemas.microsoft.com/pag/cab-profile/2.0\">"
                              + "</SolutionProfile>";

            WebServiceCatalogModuleInfoStore store =
                mockContainer.Services.AddNew <WebServiceCatalogModuleInfoStore, IModuleInfoStore>();

            store.Roles = new string[] { "tester" };

            string results = store.GetModuleListXml();

            Assert.AreEqual(contents, results);
        }