Exemplo n.º 1
0
        public void AuthLib_Reg_ReturnsError(string inputValue)
        {
            AuthLib35 authLib = new AuthLib35();

            AuthData result = authLib.Reg(inputValue);

            Assert.IsFalse(string.IsNullOrEmpty(result.error_message));
        }
Exemplo n.º 2
0
        public void AuthLib_Auth_ReturnsError(AuthData authData, string queryString, string CPCertNumber)
        {
            AuthLib35 authLib = new AuthLib35();

            AuthData result = authLib.Auth(authData, queryString, CPCertNumber);

            Assert.IsFalse(string.IsNullOrEmpty(result.error_message));
        }
Exemplo n.º 3
0
        public void AuthLib_Reg()
        {
            AuthLib35 authLib = new AuthLib35();

            AuthData result = authLib.Reg("https://int01.gismt.crpt.tech/api/v3/true-api/auth/key");

            Assert.IsNotNull(result);
            Assert.IsTrue(string.IsNullOrEmpty(result.error_message));
        }
Exemplo n.º 4
0
        public void AuthLib_Auth(string sertNum)
        {
            AuthLib35 authLib = new AuthLib35();

            AuthData result = authLib.Reg("https://int01.gismt.crpt.tech/api/v3/true-api/auth/key");

            result = authLib.Auth(result, "https://int01.gismt.crpt.tech/api/v3/true-api/auth/simpleSignIn", sertNum);

            Assert.IsNotNull(result);
            Assert.IsTrue(string.IsNullOrEmpty(result.error_message));
            Console.WriteLine(result.token);
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            AuthLib35 authLib  = new AuthLib35();
            AuthData  authData = authLib.Reg("https://int01.gismt.crpt.tech/api/v3/true-api/auth/key");

            authData = authLib.Auth(authData, "https://int01.gismt.crpt.tech/api/v3/true-api/auth/simpleSignIn", textBox1.Text);

            if (!string.IsNullOrEmpty(authData.error_message))
            {
                textBox2.Text = authData.error_message;
            }
            else
            {
                textBox2.Text = authData.token;
            }
        }