예제 #1
0
        [Test] public void tm_Server_Save()
        {
            var tmFileStorage = new TM_FileStorage();

            Assert.NotNull(tmFileStorage.path_XmlDatabase());

            var tmServerLocation = tmFileStorage.tmServer_Location();

            var tmServer_withDefaultData = new TM_Server().setDefaultData();


            Assert.IsTrue(tmServerLocation.fileExists());

            // Assert.Ignore("TO FIX (Refactor Side Effect");

            Assert.AreEqual(tmFileStorage.Server.toXml(), tmServer_withDefaultData.toXml());

            var tmpName1 = 10.randomLetters();

            tmFileStorage.Server.UserData_Configs.first().Name = tmpName1;
            Assert.IsTrue(tmFileStorage.tmServer_Save());
            Assert.AreEqual(tmServerLocation.load <TM_Server>().UserData_Configs.first().Name, tmpName1);   //check that it was  saved

            /*
             * // this works but makes the test run in 10s (and the test being done is if there is no exception)
             *
             *  var tmpName2 = 10.randomLetters();
             *  tmServerLocation.fileInfo()
             *          .setAccessControl("Users", FileSystemRights.Write, AccessControlType.Deny);
             *
             *  tmXmlDatabase.Server.UserData_Configs.first().Name = tmpName2;
             *
             *  Assert.IsFalse(tmXmlDatabase.tmServer_Save());
             *
             *  Assert.AreEqual(tmServerLocation.load<TM_Server>().UserData_Configs.first().Name, tmpName1);   //check that it was not saved
             *
             *  Assert.IsTrue(tmServerLocation.delete_File());
             *  Assert.IsFalse(tmServerLocation.fileExists());
             */
            tmFileStorage.delete_Database();
            Assert.IsFalse(tmServerLocation.fileExists());
            Assert.IsFalse(tmFileStorage.path_XmlDatabase().dirExists());

            //check when not UsingFileStorage

            //check for nulls
            tmFileStorage.Path_XmlDatabase = null;
            Assert.IsFalse(tmFileStorage.tmServer_Save());
            Assert.IsFalse(new TM_FileStorage(false).tmServer_Save());
        }
예제 #2
0
        [Test][Assert_Admin] public void set_Path_XmlDatabase__UsingFileStorage_On_Custom_WebRoot_without_Read_Privs()
        {
            admin.assert();

            var tmFileStorage = new TM_FileStorage(false);
            var tmXmlDatabase = tmFileStorage.TMXmlDatabase;

            var baseReadOnlyDir   = "_tmp_webRoot".tempDir();
            var webRootVirualPath = @"virtual/path";

            tmFileStorage.WebRoot = baseReadOnlyDir.pathCombine(webRootVirualPath).createDir();

            //Check that ensure we can write to baseReadOnlyDir
            Assert.IsTrue(baseReadOnlyDir.dirExists());
            Assert.IsTrue(tmFileStorage.WebRoot.dirExists());
            Assert.IsTrue(tmFileStorage.WebRoot.contains(baseReadOnlyDir));
            Assert.IsTrue(baseReadOnlyDir.canWriteToPath());
            Assert.AreEqual(tmFileStorage.WebRoot.parentFolder().parentFolder(), baseReadOnlyDir);

            //Now remote the write privileges for all users (on baseReadOnlyDir) while keeping  TM_Server.WebRoot writeable

            baseReadOnlyDir.directoryInfo().deny_Write_Users();
            tmFileStorage.WebRoot.directoryInfo().allow_Write_Users();

            Assert.IsFalse(baseReadOnlyDir.canWriteToPath());
            Assert.IsTrue(tmFileStorage.WebRoot.canWriteToPath());

            //Since baseReadOnlyDir can be written, creating an TM_Xml_Database should now default to the App_Data folder (which is on webRootVirualPath )

//            var tmXmlDatabase = new TM_Xml_Database().useFileStorage();

            tmFileStorage.set_Path_XmlDatabase();

            Assert.IsNotNull(tmFileStorage.path_XmlDatabase());

            none.assert();

            Assert.Ignore("TO FIX (Refactor Side Effect");
            Assert.IsTrue(tmFileStorage.path_XmlDatabase().contains("App_Data"));
            Assert.IsTrue(tmFileStorage.path_XmlDatabase().contains(tmFileStorage.WebRoot));
            Assert.IsTrue(tmFileStorage.path_XmlDatabase().contains(PublicDI.config.O2TempDir));

            //Finally re enable write so that we can delete the folder
            baseReadOnlyDir.directoryInfo().allow_Write_Users();
            Assert.IsTrue(baseReadOnlyDir.canWriteToPath());
            Files.deleteFolder(baseReadOnlyDir, true);
            Assert.IsFalse(baseReadOnlyDir.dirExists());
        }
예제 #3
0
        public void CheckDatabaseSetup()
        {
            UserGroup.Admin.assert();

            Assert.NotNull(tmXmlDatabase);
            Assert.NotNull(userData);
            Assert.NotNull(tmServer);
            Assert.NotNull(tmConfig);

            if (tmXmlDatabase.tmLibraries().notEmpty())      // temp while refactoring
            {
                tmFileStorage.delete_Database();
            }
            if (tmFileStorage.getCacheLocation().fileExists())
            {
                tmFileStorage.clear_GuidanceItemsCache();
            }

            if (userData.tmUsers().notEmpty())
            {
                userData.delete_All_Users();
            }
            //  userData.createDefaultAdminUser();

            Assert.NotNull(tmFileStorage.path_XmlDatabase(), "path_XmlDatabase()");                     // null since we are running TM memory (default setting)
            Assert.NotNull(tmFileStorage.path_XmlLibraries(), "Path_XmlLibraries");                     // null since we are running TM memory (default setting)
            Assert.IsEmpty(tmXmlDatabase.Cached_GuidanceItems, "Cached_GuidanceItems");
            Assert.IsEmpty(userData.validSessions(), "ActiveSessions");
            Assert.AreEqual(userData.TMUsers.size(), 0, "TMUsers");                                     // there should be no users

            UserGroup.None.assert();
        }
예제 #4
0
        [Test] public void set_Path_SiteData()
        {
            var tmFileStorage = new TM_FileStorage();

            var expectedPath = tmFileStorage.path_XmlDatabase().pathCombine(TMConsts.TM_SERVER_DEFAULT_NAME_SITEDATA);

            tmFileStorage.set_Path_SiteData();

            Assert.AreEqual(tmFileStorage.Path_SiteData, expectedPath);
            Assert.True(tmFileStorage.Path_SiteData.dirExists());


            // try with a different Name value
            var tempName = 10.randomLetters();

            tmFileStorage.Server.siteData_Config().Name = tempName;
            tmFileStorage.set_Path_SiteData();
            Assert.IsTrue(tmFileStorage.Path_SiteData.contains(tempName));

            //check bad data handling
            tmFileStorage.Server.siteData_Config().Name = null;
            tmFileStorage.set_Path_SiteData();
            Assert.IsTrue(tmFileStorage.Path_SiteData.contains(TMConsts.TM_SERVER_DEFAULT_NAME_SITEDATA));


            tmFileStorage.Server.siteData_Config().Name = "aaa:bbb"; // will fail to create the SiteData folder and force memory mode
            tmFileStorage.set_Path_SiteData();
            Assert.IsNull(tmFileStorage.Path_SiteData);
        }
예제 #5
0
        public static TM_FileStorage delete_Database(this TM_FileStorage tmFileStorage)
        {
            tmFileStorage.assert_Not_Null()
            .path_XmlDatabase().assert_Not_Null()
            .assert_Is_Not_Equal_To(tmFileStorage.WebRoot);

            if (tmFileStorage.path_XmlDatabase().dirExists())                                            // check if the folder exists
            {
                //Assert.IsNotEmpty(tmDatabase.path_XmlDatabase().files());

                tmFileStorage.path_XmlDatabase().files(true).files_Attribute_ReadOnly_Remove();          // make all files writable


                tmFileStorage.waitForComplete_Save_GuidanceItemsCache();
                tmFileStorage.clear_GuidanceItemsCache();

                Files.deleteFolder(tmFileStorage.path_XmlDatabase(), true);                              // delete all files recusively
                tmFileStorage.path_XmlDatabase().folder_Wait_For_Deleted();
                tmFileStorage.path_XmlDatabase().assert_Folder_Doesnt_Exist();


                Assert.IsFalse(tmFileStorage.path_XmlDatabase().dirExists());                            // ensure the deletion happened
                Assert.IsEmpty(tmFileStorage.path_XmlDatabase().files());
                Assert.IsEmpty(tmFileStorage.tmXmlDatabase().Cached_GuidanceItems);
                Assert.IsFalse(tmFileStorage.getCacheLocation().fileExists());
                "[Test][TM_Xml_Database][delete_Database]TM database files were deleted from: {0}".info(tmFileStorage.path_XmlDatabase());
            }
            return(tmFileStorage);
        }
예제 #6
0
        [Test] public void set_WebRoot()
        {
            TM_FileStorage.Custom_WebRoot = null;
            var custom_WebRoot            = "Custom_WebRoot".tempDir().assert_Folder_Exists();
            var expected_Path_XmlDatabase = custom_WebRoot.pathCombine(@"App_Data\TeamMentor");

            UserRole.Admin.assert();

            TM_FileStorage.Custom_WebRoot.assert_Null();
            var tmFileStorage = new TM_FileStorage(loadData: false);

            tmFileStorage.webRoot().assert_Null();
            tmFileStorage.set_WebRoot();
            tmFileStorage.webRoot().assert_Not_Null()
            .assert_Equal(AppDomain.CurrentDomain.BaseDirectory);


            TM_FileStorage.Custom_WebRoot = custom_WebRoot;
            tmFileStorage.webRoot().assert_Equal(AppDomain.CurrentDomain.BaseDirectory)     // should still point to the AppDomain base directory
            .assert_Not_Equal(custom_WebRoot);

            tmFileStorage.using_Custom_WebRoot().assert_False();                            // this should only be true when the values match

            tmFileStorage.set_WebRoot()                                                     // set WebRoot
            .webRoot().assert_Equals(custom_WebRoot);                                       // and confirm its location

            tmFileStorage.using_Custom_WebRoot().assert_True();                             // now it should be true
            tmFileStorage.path_XmlDatabase().assert_Null();                                 // confirm that not set
            tmFileStorage.set_Path_XmlDatabase();                                           // this should set the TM_Xml_Database inside the Web_Root
            tmFileStorage.path_XmlDatabase().contains(custom_WebRoot);
            tmFileStorage.path_XmlDatabase().assert_Is_Equal_To(expected_Path_XmlDatabase); // check that the current Path_XmlDatabase matches the expected location


            //reset values
            TM_FileStorage.Custom_WebRoot = null;

            tmFileStorage.set_WebRoot()
            .webRoot().assert_Not_Equals(custom_WebRoot);

            Files.delete_Folder_Recursively(custom_WebRoot).assert_True();
            custom_WebRoot.assert_Folder_Doesnt_Exist();
        }
예제 #7
0
        [Test] public void set_Path_XmlDatabase__UsingFileStorage_On_Custom_WebRoot()
        {
            var tmFileStorage = new TM_FileStorage(false);

            //Assert.AreEqual(tmFileStorage.WebRoot, AppDomain.CurrentDomain.BaseDirectory);
            tmFileStorage.WebRoot = "_tmp_webRoot".tempDir().info();

            tmFileStorage.WebRoot.delete_Folder();
            Assert.IsFalse(tmFileStorage.WebRoot.dirExists());

            tmFileStorage.set_Path_XmlDatabase();

            Assert.IsTrue(tmFileStorage.path_XmlDatabase().dirExists(), "db ctor should create a library folder");

            var usingAppDataFolder = TM_Status.Current.TM_Database_Location_Using_AppData;

            "*** DB path: {0}".info(tmFileStorage.path_XmlDatabase());
            "*** Lib path: {0}".info(tmFileStorage.Path_XmlLibraries);
            "*** Current WebRoot: {0}".debug(tmFileStorage.WebRoot);
            "*** Current WebRoot exists: {0}".debug(tmFileStorage.WebRoot.dirExists());
            "*** TM_Status.Current.TM_Database_Location_Using_AppData: {0}".debug(TM_Status.Current.TM_Database_Location_Using_AppData);

            Assert.AreEqual(usingAppDataFolder, tmFileStorage.WebRoot.dirExists(), "db ctor should not create a Web Root (if it doesn't exist)");
            Assert.AreEqual(usingAppDataFolder, tmFileStorage.path_XmlDatabase().contains("App_Data"));
            Assert.AreEqual(usingAppDataFolder, tmFileStorage.path_XmlDatabase().contains(tmFileStorage.WebRoot));
            Assert.AreEqual(usingAppDataFolder, tmFileStorage.path_XmlDatabase().contains(PublicDI.config.O2TempDir));

            tmFileStorage.delete_Database();

            Assert.AreEqual(usingAppDataFolder, tmFileStorage.WebRoot.dirExists(), "if not usingAppDataFolder the TM_Server.WebRoot shouldn't exist");
            Assert.IsFalse(tmFileStorage.path_XmlDatabase().dirExists(), "should had been deleted");
        }
예제 #8
0
        [Test] public void tm_Server_Load_UsingFileStorage()
        {
            var tmFileStorage = new TM_FileStorage(false);

            var baseReadOnlyDir   = "_tmp_webRoot".tempDir();
            var webRootVirualPath = @"site\wwwroot";        // simulates use of AppData

            tmFileStorage.WebRoot = baseReadOnlyDir.pathCombine(webRootVirualPath).createDir();

            tmFileStorage.set_Path_XmlDatabase()
            .set_Path_UserData()
            .tmServer_Load();

            var tmServerFile     = tmFileStorage.tmServer_Location();
            var expectedLocation = tmFileStorage.Path_XmlDatabase.pathCombine(TMConsts.TM_SERVER_FILENAME);

            Assert.IsNotNull(tmFileStorage.path_XmlDatabase());
            Assert.IsTrue(TM_Status.Current.TM_Database_Location_Using_AppData);
            Assert.NotNull(tmFileStorage.Server);
            Assert.IsTrue(tmServerFile.fileExists());
            Assert.AreEqual(tmServerFile, expectedLocation);

//            Assert.Ignore("TO FIX (Refactor Side Effect");
            //       Assert.Ignore("TO FIX (Refactor Side Effect");
            var tmServer_withDefaultData = new TM_Server().setDefaultData();

            Assert.AreEqual(tmFileStorage.Server.toXml(), tmServer_withDefaultData.toXml());

            //make a change, saved it and ensure it gets loaded ok

            var tmpName1 = 10.randomLetters();
            var tmpName2 = 10.randomLetters();

            tmFileStorage.Server.UserData_Configs.first().Name = tmpName1;
            tmFileStorage.tmServer_Save();
            tmFileStorage.Server.UserData_Configs.first().Name = tmpName2;

            tmFileStorage.tmServer_Load();
            Assert.AreEqual(tmFileStorage.Server.UserData_Configs.first().Name, tmpName1);
            Assert.AreNotEqual(tmFileStorage.Server.toXml(), tmServer_withDefaultData.toXml());

            //Try loading up an corrupted tmServer (whcih will default to load a default TM_Server
            "aaaa".saveAs(tmServerFile);
            tmFileStorage.tmServer_Load();
            Assert.AreNotEqual(tmFileStorage.Server.UserData_Configs.first().Name, tmpName1);
            Assert.AreEqual(tmFileStorage.Server.toXml(), tmServer_withDefaultData.toXml());

            Files.deleteFolder(baseReadOnlyDir, true);
            Assert.IsFalse(baseReadOnlyDir.dirExists());

            //tmXmlDatabase.delete_Database();
        }
예제 #9
0
        [Test] public void set_Path_XmlDatabase__UsingFileStorage()
        {
            var tmFileStorage = new TM_FileStorage();
            var tmXmlDatabase = tmFileStorage.TMXmlDatabase;

            tmFileStorage.set_Path_XmlDatabase();

            Assert.AreEqual(tmXmlDatabase, TM_Xml_Database.Current);
            Assert.IsTrue(tmXmlDatabase.usingFileStorage());
            Assert.IsNotNull(tmFileStorage.path_XmlDatabase());

            tmFileStorage.delete_Database();
        }
        public static bool                               loadDataIntoMemory(this TM_FileStorage tmFileStorage)
        {
            if (tmFileStorage.path_XmlDatabase().dirExists().isFalse())
            {
                "[TM_Xml_Database] in loadDataIntoMemory, provided pathXmlDatabase didn't exist: {0}".error(tmFileStorage.path_XmlDatabase());
                return(false);
            }
            tmFileStorage.loadLibraryDataFromDisk();

            //tmXmlDatabase.setupGitSupport();
            //tmXmlDatabase.UserData.loadTmUserData();
            return(true);
        }
예제 #11
0
        [Test] public void set_Path_UserData()
        {
            var tmFileStorage = new TM_FileStorage();

            var expectedPath = tmFileStorage.path_XmlDatabase().pathCombine(TMConsts.TM_SERVER_DEFAULT_NAME_USERDATA);

            tmFileStorage.set_Path_UserData();
            var userData = tmFileStorage.UserData;

            //Assert.NotNull (tmServer);
            Assert.NotNull(userData);
            Assert.AreEqual(tmFileStorage.Path_UserData, expectedPath);
            Assert.True(tmFileStorage.Path_UserData.dirExists());


            // try with a different Name value
            var tempName = 10.randomLetters();

            tmFileStorage.Server.userData_Config().Name = tempName;
            tmFileStorage.set_Path_UserData();
            Assert.IsTrue(tmFileStorage.Path_UserData.contains(tempName));


            tmFileStorage.delete_Database();
            Assert.False(tmFileStorage.Path_UserData.dirExists());

            //check bad data handling
            tmFileStorage.Server.userData_Config().Name = null;
            tmFileStorage.set_Path_UserData();
            Assert.IsTrue(tmFileStorage.Path_UserData.contains(TMConsts.TM_SERVER_DEFAULT_NAME_USERDATA));


            tmFileStorage.Server.userData_Config().Name = "aaa:bbb"; // will fail to create the UserData folder and force memory mode
            tmFileStorage.set_Path_UserData();
            Assert.IsNotNull(tmFileStorage.UserData);
            Assert.IsNull(tmFileStorage.Path_UserData);



            //test nulls
            tmFileStorage.Server        = null;
            tmFileStorage.UserData      = null;
            tmFileStorage.TMXmlDatabase = null;
            tmFileStorage.set_Path_UserData();

            Assert.IsNull(tmFileStorage.Path_UserData);

            //Assert.IsNull (new TM_FileStorage(false).set_Path_UserData().Path_UserData);
        }
예제 #12
0
        [Test] public void set_Path_XmlDatabase__In_Memory()
        {
            var tmFileStorage = new TM_FileStorage(false);
            var tmXmlDatabase = tmFileStorage.TMXmlDatabase;

            Assert.AreEqual(tmFileStorage, tmFileStorage.set_Path_XmlDatabase());
            Assert.AreEqual(tmXmlDatabase, TM_Xml_Database.Current);
            Assert.IsNull(tmFileStorage.path_XmlDatabase());
            Assert.IsFalse(tmXmlDatabase.usingFileStorage());

            var tmXmlDatabase2 = new TM_Xml_Database();

            Assert.AreNotEqual(tmXmlDatabase, tmXmlDatabase2, "A new tmXmlDatabase1 should had been created");
            Assert.AreEqual(tmXmlDatabase2, TM_Xml_Database.Current);
        }
예제 #13
0
        [Test] public void set_Path_XmlLibraries()
        {
            var tmFileStorage = new TM_FileStorage(false);

            TMConfig.Current = null;

            //this is the sequence that needs to be loaded in order to have a Path for Xml Libraries
            tmFileStorage.set_WebRoot()
            .set_Path_XmlDatabase()
            .tmServer_Load()
            .set_Path_UserData()                        //
            .tmConfig_Load()                            //
            .set_Path_XmlLibraries();

            Assert.NotNull(tmFileStorage.path_XmlDatabase());
            Assert.NotNull(tmFileStorage.path_XmlLibraries());
            Assert.IsTrue(tmFileStorage.path_XmlDatabase().dirExists());
            Assert.IsTrue(tmFileStorage.path_XmlLibraries().dirExists());
            Assert.NotNull(TMConfig.Current);

            //test nulls
            tmFileStorage.Path_XmlLibraries = null;

            //in the scenarios below the tmFileStorage.Path_XmlLibraries should not be set
            if (TMConfig.Current.notNull())
            {
                TMConfig.Current.TMSetup = null;
            }
            tmFileStorage.set_Path_XmlLibraries();
            TMConfig.Current = null;
            tmFileStorage.set_Path_XmlLibraries();
            Assert.IsNull(tmFileStorage.Path_XmlLibraries);

            //tmXmlDatabase.delete_Database();
            //TMConfig.Current = new TMConfig();
        }
예제 #14
0
파일: TM_StartUp.cs 프로젝트: rbg13/Master
        public void Application_Start()
        {
            UserGroup.Admin.assert();                                   // impersonate an admin to load the database

            "[TM_StartUp] Application Start".info();

            TmFileStorage = new TM_FileStorage();                       // this will trigger the load of all TM_Xml_Database data


            TmFileStorage.UserData.createDefaultAdminUser();                                  // ensures that there is an valid admin

            TrackingApplication = new Tracking_Application(TmFileStorage.path_XmlDatabase()); // Enabled Application Tracking

            TM_REST.SetRouteTable();                                                          // Set REST routes
            MVC5.MapDefaultRoutes();                                                          // Map MVC 5 routes

            TrackingApplication.saveLog();                                                    // save log

            UserGroup.None.assert();                                                          // revert admin user impersonation
        }
예제 #15
0
        [Test] public void set_Path_XmlDatabase__UsingFileStorage_On_AppData__without_Read_Privs()
        {
            var tmFileStorage = new TM_FileStorage(false);
            var tmXmlDatabase = tmFileStorage.TMXmlDatabase;

            var baseReadOnlyDir   = "_tmp_webRoot".tempDir();
            var webRootVirualPath = @"site\wwwroot";        // simulates use of AppData

            tmFileStorage.WebRoot = baseReadOnlyDir.pathCombine(webRootVirualPath).createDir();

            tmFileStorage.WebRoot.directoryInfo().deny_CreateDirectories_Users();

            //var tmXmlDatabase = new TM_Xml_Database().useFileStorage();       // usually a true paramater will set UsingFileStorage to true

            tmFileStorage.set_Path_XmlDatabase();

            Assert.IsNull(tmFileStorage.path_XmlDatabase());       // if we can't write to the AppData folder then this value can't be set automatically
            Assert.IsFalse(tmXmlDatabase.usingFileStorage());      // and the offline mode (i.e. UsingFileStorage = false) should be activated
            Files.deleteFolder(baseReadOnlyDir, true);
            Assert.IsFalse(baseReadOnlyDir.dirExists());
        }
예제 #16
0
        [Admin][Test] public void set_Path_XmlDatabase()
        {
            admin.assert();
            var custom_WebRoot = TM_FileStorage.Custom_WebRoot = "Custom_WebRoot".tempDir().assert_Folder_Exists();

            var tmFileStorage = new TM_FileStorage(loadData: false)
                                .set_WebRoot()
                                .set_Path_XmlDatabase();

            var path_XmlDatabase = tmFileStorage.path_XmlDatabase().assert_Folder_Exists()
                                   .assert_Contains(custom_WebRoot);


            // check use of TM_FileStorage.Custom_Path_TM_Xml_Database

            TM_FileStorage.Custom_Path_XmlDatabase.assert_Null();

            TM_FileStorage.Custom_Path_XmlDatabase = 10.randomLetters();                       // with a random value
            tmFileStorage.set_Path_XmlDatabase()
            .path_XmlDatabase().assert_Is_Equal_To(path_XmlDatabase);                          // this value should not be changed

            var custom_Path_TM_Xml_Database = "Custom_Path_TM_Xml_Database".add_5_RandomLetters()
                                              .inTempDir()
                                              .assert_Folder_Doesnt_Exist();

            TM_FileStorage.Custom_Path_XmlDatabase = custom_Path_TM_Xml_Database;              // with a folder that doesn't exist

            tmFileStorage.set_Path_XmlDatabase()
            .path_XmlDatabase().assert_Is_Equal_To(path_XmlDatabase);                          // should still be unchanged

            custom_Path_TM_Xml_Database.createDir().assert_Folder_Exists();                    // create the folder
            tmFileStorage.set_Path_XmlDatabase()
            .path_XmlDatabase().assert_Is_Equal_To(custom_Path_TM_Xml_Database);               // and the value should be set

            Files.delete_Folder_Recursively(custom_Path_TM_Xml_Database).assert_True();
            Files.delete_Folder_Recursively(custom_WebRoot).assert_True();

            none.assert();
        }
예제 #17
0
        public void set_Default_Values()
        {
            var tmFileStorage = new TM_FileStorage(false);
            var tmXmlDatabase = tmFileStorage.TMXmlDatabase;

            var events = tmXmlDatabase.Events;               // this value should not change

            tmXmlDatabase.set_Default_Values();

            Assert.NotNull(tmXmlDatabase);

            Assert.IsEmpty(tmXmlDatabase.Cached_GuidanceItems);
            Assert.IsEmpty(tmFileStorage.GuidanceItems_FileMappings);
            Assert.IsEmpty(tmXmlDatabase.GuidanceExplorers_XmlFormat);
            Assert.IsEmpty(tmXmlDatabase.VirtualArticles);
            Assert.AreEqual(tmXmlDatabase.Events, events);

            Assert.IsNull(tmFileStorage.path_XmlDatabase());
            Assert.IsEmpty(tmFileStorage.GuidanceExplorers_Paths);
            Assert.IsNull(tmFileStorage.Path_XmlLibraries);
            Assert.IsNotNull(tmFileStorage.UserData);
            Assert.IsNotNull(tmFileStorage.Server);
        }
        public static string                             getCacheLocation(this TM_FileStorage tmFileStorage)                //, TM_Library library)
        {
            var pathXmlDatabase = tmFileStorage.path_XmlDatabase();

            return(pathXmlDatabase.pathCombine("Cache_guidanceItems.cacheXml"));//.format(library.Caption));
        }