public void ReturnsNullWhenFileNotPresent()
        {
            string filename = Guid.NewGuid().ToString();
            ProfileCatalogModuleInfoStore store = new ProfileCatalogModuleInfoStore();

            store.CatalogFilePath = filename;

            string results = store.GetModuleListXml();

            Assert.IsNull(results);
        }
        public void ReadsContentsOfFileFromDiskAsString()
        {
            string filename = Path.GetTempFileName();
            string contents = "1 2 3\n4 5\n 6";

            File.WriteAllText(filename, contents);
            ProfileCatalogModuleInfoStore store = new ProfileCatalogModuleInfoStore();

            store.CatalogFilePath = filename;

            string results = store.GetModuleListXml();

            Assert.AreEqual(contents, results);
        }
        protected override void AddServices()
        {
            base.AddServices();

            // use custom Profile Catalog
            ProfileCatalogModuleInfoStore infoStore = RootWorkItem.Services.AddNew <ProfileCatalogModuleInfoStory, IMo>();

            if (ProfileCatalogFileName != null)
            {
                infoStore.CatalogFilePath = ProfileCatalogFileName;
            }

            RootWorkItem.Services.AddNew <WorkspaceLocatorService, IWorkspaceLocatorService>();
            RootWorkItem.Services.Remove <IModuleEnumerator>();
            RootWorkItem.Services.AddNew <XmlStreamDependentModuleEnumerator, IModuleEnumerator>();;
            RootWorkItem.Services.AddNew <DependentModuleLoaderService, IModuleLoaderService>();
            RootWorkItem.Services.AddOnDemand <ActionCatalogService, IActionCatalogService>();
            RootWorkItem.Services.AddOnDemand <EntityTranslatorService, IEntityTranslatorService>();
        }
        public void DefaultCatalogFilePathIsProfileCatalogDotXml()
        {
            ProfileCatalogModuleInfoStore store = new ProfileCatalogModuleInfoStore();

            Assert.AreEqual("profilecatalog.xml", store.CatalogFilePath.ToLowerInvariant());
        }
        public void EmptyStringThrows()
        {
            ProfileCatalogModuleInfoStore store = new ProfileCatalogModuleInfoStore();

            store.CatalogFilePath = "";
        }
        public void NullFileThrows()
        {
            ProfileCatalogModuleInfoStore store = new ProfileCatalogModuleInfoStore();

            store.CatalogFilePath = null;
        }