Example #1
0
 public void SetUp()
 {
     var assembly = this.type().Assembly;
     var dllLocation = assembly.CodeBase.subString(8);
     var webApplications = dllLocation.parentFolder().pathCombine(@"\..\..\..");
     TMRestUser = new TM_REST();
     var tmWebsite = webApplications.pathCombine("TM_Website");
     moq_HttpContext = new API_Moq_HttpContext(tmWebsite);
     var tmConfig = TMConfig.Current;
     var credentials = new TM_Credentials { UserName = tmConfig.TMSecurity.Default_AdminUserName, Password = tmConfig.TMSecurity.Default_AdminPassword };
     //login with default value
     var sessionId = TmRest.Login_using_Credentials(credentials);
 }
Example #2
0
        public void Login()
        {
            var tmConfig = TMConfig.Current;
            var credentials = new TM_Credentials { UserName = tmConfig.TMSecurity.Default_AdminUserName, Password = tmConfig.TMSecurity.Default_AdminPassword};
            //login with default value
            var sessionId = TmRest.Login_using_Credentials(credentials);

            Assert.AreNotEqual(sessionId, Guid.Empty);
            //login with a bad password
            credentials.Password = "AAAA";
            sessionId = TmRest.Login_using_Credentials(credentials);
            Assert.AreEqual(sessionId, Guid.Empty);
        }
Example #3
0
 public Guid Login_using_Credentials(TM_Credentials credentials)
 {
     return TmWebServices.Login(credentials.UserName, credentials.Password);
 }