示例#1
0
        [Test] public void CheckGitRepoDoesNotCommit_OnNewUser()
        {
            Assert.NotNull(tmServer);
            Assert.IsTrue(tmServer.Git.UserData_Git_Enabled);

            nGit.status().assert_Empty();

            userData.newUser();                        // adding a user
            Assert.IsNotNull(nGit.head());
            userData.newUser();                        // adding another user

            nGit.status().assert_Not_Empty();

            var headBeforeUser = nGit.head();

            userData.newUser();

            nGit.head().assert_Not_Null()
            .assert_Equal(headBeforeUser, "Git Head value are still the same here");

            nGit.commits().assert_Size_Is(2);

            userDataGit.triggerGitCommit();                 // manually trigger the commit
            nGit.status().assert_Empty();
            nGit.commits().assert_Size_Is(3);

            UserGroup.None.assert();
        }
示例#2
0
        [SetUp][Admin] public void setUp()
        {
            UserGroup.Admin.assert();

            //create TM_FileStorage on temp Custom_WebRoot for this TestFixture
            TM_FileStorage.Custom_WebRoot = "custom_WebRoot".tempDir();

            tmFileStorage = new TM_FileStorage(false);
            tmFileStorage.set_WebRoot()
            .set_Path_XmlDatabase()
            .tmServer_Load()
            .set_Path_UserData()
            .load_UserData();
            tmFileStorage.hook_Events_TM_UserData();

            tmXmlDatabase = tmFileStorage.TMXmlDatabase.assert_Not_Null();
            userData      = tmFileStorage.UserData.assert_Not_Null();
            tmServer      = tmFileStorage.Server.assert_Not_Null();

            tmFileStorage.Path_XmlDatabase.assert_Folder_Exists();
            tmFileStorage.Path_UserData.assert_Folder_Exists();

            userDataGit = tmFileStorage.setup_UserData_Git_Support();           // adds Git Support for UserData repos

            tmFileStorage.Path_UserData.isGitRepository().assert_True();

            Assert.NotNull(tmFileStorage.Server.userData_Config());

            userData.createDefaultAdminUser();

            userDataGit.triggerGitCommit();

            nGit = userDataGit.NGit;

            nGit.commits().assert_Size_Is(2, "there should be two commits here");

            UserGroup.None.assert();
        }