Exemplo n.º 1
0
        [Test] 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 = "******";
            sessionId            = TmRest.Login_using_Credentials(credentials);
            Assert.AreEqual(sessionId, Guid.Empty);
        }
Exemplo n.º 2
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);
        }