Example #1
0
 public static bool          delete_User(this TM_WebServices webServices, TM_User tmUser)
 {
     if (tmUser.notNull())
     {
         return(webServices.DeleteUser(tmUser.UserId));
     }
     return(false);
 }
Example #2
0
        public static Guid          user_AuthToken(this TM_WebServices webServices, int userId)
        {
            var existingTokens = webServices.GetUser_AuthTokens(userId);

            if (existingTokens.size() > 0)
            {
                return(existingTokens.first());
            }
            return(webServices.CreateUser_AuthToken(userId));
        }
Example #3
0
        [Test] public void Issue_681__Navigating_libraries_views_folders__Clicking_the_icon_doesnt_work()
        {
            var tmWebServices = new TM_WebServices();

            Func <string, string> clickOnNodeUsingJQuerySelector =
                (jQuerySelector) =>
            {
                ie.invokeEval("TM.Gui.selectedGuidanceTitle=undefined");
                ie.invokeEval("$('#{0}').click()".format(jQuerySelector));
                ie.waitForJsVariable("TM.Gui.selectedGuidanceTitle");
                return(ie.getJsObject <string>("TM.Gui.selectedGuidanceTitle"));
            };

            if (tmProxy.libraries().notEmpty())
            {
                "Ensuring the the only library that is there is the TM Documentation".info();
                foreach (var library in tmProxy.libraries())
                {
                    if (library.Caption != "TM Documentation")
                    {
                        "deleting library: {0}".debug(library.Caption);
                        tmProxy.library_Delete(library.Caption);
                    }
                }
            }

            UserRole.Admin.assert();

            tmProxy.library_Install_Lib_Docs();
            tmProxy.cache_Reload__Data();
            tmProxy.show_ContentToAnonymousUsers(true);

            ieTeamMentor.page_Home();
            //tmWebServices.script_Me_WaitForClose();;
            //ieTeamMentor.script_IE_WaitForComplete();

            ie.waitForJsVariable("TM.Gui.selectedGuidanceTitle");

            var _jsTree   = tmWebServices.JsTreeWithFolders();
            var viewNodes = _jsTree.data[0].children;                           // hard coding to the first library
            var view1_Id  = viewNodes[0].attr.id;
            var view5_Id  = viewNodes[4].attr.id;


            var click_View_1_Using_A    = clickOnNodeUsingJQuerySelector(view1_Id + " a");
            var click_View_5_Using_A    = clickOnNodeUsingJQuerySelector(view5_Id + " a");
            var click_View_1_Using_Icon = clickOnNodeUsingJQuerySelector(view1_Id + " ins");
            var click_View_5_Using_Icon = clickOnNodeUsingJQuerySelector(view5_Id + " ins");


            (click_View_1_Using_A != click_View_5_Using_A).assert_True();

            (click_View_5_Using_A == click_View_1_Using_Icon).assert_False(); // (Issue 681) this was true since the view was not updating
            (click_View_5_Using_A == click_View_5_Using_Icon).assert_True();
        }
Example #4
0
        public static int           add_User(this TM_WebServices webServices, string username, string password)
        {
            var newUser = new NewUser
            {
                Username = username,
                Password = password,
                Email    = "{0}@{1}.com".format(10.randomLetters(), 10.randomLetters()),
            };

            return(webServices.add_User(newUser));
        }
Example #5
0
        public TM_WebServices_InMemory()
        {
            HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
            tmWebServices = new TM_WebServices();

            Assert.NotNull(tmWebServices);
            Assert.IsNull(tmWebServices.tmFileStorage);
            Assert.NotNull(tmWebServices.tmAuthentication);
            Assert.NotNull(tmWebServices.tmXmlDatabase);
            Assert.NotNull(tmWebServices.userData);
        }
		public void openBrowser()
		{
			tmWebServices = new TM_WebServices();
			base.set_IE_Object("Test_TM_IE_GuiObjects_vs_Database");	
			
			if(ie.url().isNull() || ie.url().contains(startPage).isFalse())			
				base.open(startPage + "?time="+ DateTime.Now.Ticks);			
				
			var value = ie.waitForJsVariable("TM.Debug.UnitTest_Message").str();			
			Assert.AreEqual(value.str(), "Test Complete","UnitTest_Message");			
		}
Example #7
0
 public static void testsSetUp()
 {
     "in testsSetUp".info();
     ActivityDB.DontLog = true;
     //TM_Xml_Database.setDataFromCurrentScript("..\\..");
     tmXmlDatabase_JavascriptProxy = UnityInjection.useEnvironment_XmlDatabase();
     tmXmlDatabase = tmXmlDatabase_JavascriptProxy.tmXmlDatabase;
     moq_Container = UnityInjection.container;
     tmWebServices = moq_Container.Resolve <TM_WebServices>();             // new TM_WebServices();
     "done in testsSetUp".info();
 }
Example #8
0
        public static int           add_User(this TM_WebServices webServices, NewUser newUser)
        {
            var userValidationErrors = webServices.CreateUser_Validate(newUser);

            if (userValidationErrors.notEmpty())
            {
                "[add_User] There where validations: {0}".error(userValidationErrors.asString());
                return(-1);
            }
            var userId = webServices.CreateUser(newUser);

            return(userId);
        }
Example #9
0
 public static bool          login_with_AuthToken(this TM_WebServices webServices, Guid authToken)
 {
     try
     {
         "[TeamMentor] login using AuthToken".info();
         webServices.Login_Using_AuthToken(authToken);
         return(webServices.Current_User().notNull());
     }
     catch (Exception ex)
     {
         ex.log();
     }
     return(false);
 }
Example #10
0
 public static bool          login_with_Pwd(this TM_WebServices webServices, string username, string password)
 {
     try
     {
         "[TeamMentor] login as: {0}".info(username);
         webServices.Login(username, password);
         return(webServices.Current_User().notNull());
     }
     catch (Exception ex)
     {
         ex.log();
     }
     return(false);
 }
        public void openBrowser()
        {
            tmWebServices = new TM_WebServices();
            base.set_IE_Object("Test_TM_IE_GuiObjects_vs_Database");

            if (ie.url().isNull() || ie.url().contains(startPage).isFalse())
            {
                base.open(startPage + "?time=" + DateTime.Now.Ticks);
            }

            var value = ie.waitForJsVariable("TM.Debug.UnitTest_Message").str();

            Assert.AreEqual(value.str(), "Test Complete", "UnitTest_Message");
        }
Example #12
0
 public TM_WebServices_InMemory()
 {
     HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
     //tmXmlDatabase    = new TM_Xml_Database();
     tmWebServices = new TM_WebServices();
 }
Example #13
0
 public Test_TM_WSDL_SecurityTests()
 {
     tmWebServices     = new TM_WebServices();
     tmWebServices.Url = Test_TM.tmWebServices;
 }
 public Test_TM_WSDL_SecurityTests()
 {
     tmWebServices = new TM_WebServices();
     tmWebServices.Url = Test_TM.tmWebServices;
 }
Example #15
0
 public static TM_User       user(this TM_WebServices webServices, int userId)
 {
     return(webServices.GetUser_byID(userId));
 }
 public Test_TM_Gui_Objects_via_WSDL()
 {
     tmWebServices     = new TM_WebServices();
     tmWebServices.Url = Test_TM.tmWebServices;
 }
Example #17
0
        public static bool          delete_User(this TM_WebServices webServices, string userName)
        {
            var tmUser = webServices.user(userName);

            return(webServices.delete_User(tmUser));
        }
 public Test_TM_WSDL_ErrorHandling()
 {
     tmWebServices = new TM_WebServices();
     tmWebServices.Url = Test_TM.tmWebServices;
 }
Example #19
0
 public TM_WebServices_FileStorage()
 {
     HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
     tmWebServices = new TM_WebServices();
     Assert.NotNull(tmWebServices);
 }
Example #20
0
 public static bool          loggedIn(this TM_WebServices webServices)
 {
     return(webServices.sessionId() != Guid.Empty);
 }
Example #21
0
 public static TM_User       user(this TM_WebServices webServices, string userName)
 {
     return(webServices.GetUser_byName(userName));
 }
Example #22
0
 public static bool          logout(this TM_WebServices webServices)
 {
     return(webServices.Logout() == Guid.Empty);
 }
Example #23
0
 public static bool          delete_User(this TM_WebServices webServices, int userId)
 {
     return(webServices.DeleteUser(userId));
 }
Example #24
0
 public static TM_User       current_User(this TM_WebServices webServices)
 {
     return(webServices.Current_User());
 }
Example #25
0
 public static List <TM_User> users(this TM_WebServices webServices)
 {
     return(webServices.GetUsers().toList());
 }
    	public Test_TM_Gui_Objects_via_WSDL()
    	{
			tmWebServices = new TM_WebServices();    	
			tmWebServices.Url = Test_TM.tmWebServices;
    	}
 public Test_TM_WSDL_ErrorHandling()
 {
     tmWebServices     = new TM_WebServices();
     tmWebServices.Url = Test_TM.tmWebServices;
 }
 public API_TeamMentor_WebServices(string websiteUrl)
 {
     this.WebSite_Url 		= websiteUrl.uri();
     this.webServices  	 = new TM_WebServices_Configured(this.WebSite_Url);
 }
Example #29
0
 public static Guid          current_SessionId(this TM_WebServices webServices)
 {
     return(webServices.Current_SessionID());
 }
Example #30
0
 public TM_WebServices_InMemory()
 {
     HttpContextFactory.Context = new API_Moq_HttpContext().httpContext();
     tmWebServices = new TM_WebServices();
 }
Example #31
0
 public static int           add_User(this TM_WebServices webServices)
 {
     return(webServices.add_User(10.randomLetters(), "!!123".add_RandomLetters(10)));
 }