public void TestLocalBadgeCode()
        {
            bool   actual           = false;
            bool   expected         = true;
            string workerLoginName  = "Administrator";
            string workerBadgeCode  = "12345";
            string stationName      = "ST10";
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.BadgeCode);
            WorkerLoginResult   res = wa.Login(string.Empty, string.Empty, workerBadgeCode, stationName);

            if (wa.CurrentWorker.LoginName == workerLoginName && res == WorkerLoginResult.Ok)
            {
                actual = true;
            }
            Assert.AreEqual(expected, actual);
        }
        public void TestLocalUserPassword()
        {
            bool   actual           = false;
            bool   expected         = true;
            string workerLoginName  = "Administrator";
            string workerPassword   = "******";
            string stationName      = "ST10";
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.UserPassword);
            WorkerLoginResult   res = wa.Login(workerLoginName, workerPassword, string.Empty, stationName);

            if (res == WorkerLoginResult.Ok)
            {
                actual = true;
            }
            Assert.AreEqual(expected, actual);
        }
        public void TestRemoteBadgeCode()
        {
            bool   actual           = false;
            bool   expected         = true;
            string workerLoginName  = "marco.dallera";
            string workerBadgeCode  = ";80380000100118208054?";
            string stationName      = "ST60.00";
            string connectionString = "Data Source=192.168.100.250;Initial Catalog=TraMa4_520-334;User ID=TraMa;Password=trama";
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.BadgeCode, connectionString);
            WorkerLoginResult   res = wa.Login(string.Empty, string.Empty, workerBadgeCode, stationName);

            if (wa.CurrentWorker.LoginName == workerLoginName && res == WorkerLoginResult.Ok)
            {
                actual = true;
            }
            Assert.AreEqual(expected, actual);
        }
        public void TestRemoteUserPassword()
        {
            bool   actual           = false;
            bool   expected         = true;
            string workerLoginName  = "marco.dallera";
            string workerPassword   = "******";
            string stationName      = "ST60.00";
            string connectionString = "Data Source=192.168.100.250;Initial Catalog=TraMa4_520-334;User ID=TraMa;Password=trama";
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.UserPassword, connectionString);
            WorkerLoginResult   res = wa.Login(workerLoginName, workerPassword, string.Empty, stationName);

            if (res == WorkerLoginResult.Ok)
            {
                actual = true;
            }
            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void TestLocalBadgeCodeKo()
        {
            bool   actual          = false;
            bool   expected        = true;
            string workerLoginName = string.Empty;
            string workerBadgeCode = "12345";
            string stationName     = "ST99C";

            Init_PB139();
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.BadgeCode);
            WorkerLoginResult   res = wa.Login(string.Empty, string.Empty, workerBadgeCode, stationName);

            if (wa.CurrentWorker.LoginName == workerLoginName && res == WorkerLoginResult.Failed)
            {
                actual = true;
            }
            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void TestLocalUserPasswordKo()
        {
            bool   actual          = false;
            bool   expected        = true;
            string workerLoginName = "FakeUser";
            string workerPassword  = "******";
            string stationName     = "ST104F";

            Init_PB139();
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.UserPassword);
            WorkerLoginResult   res = wa.Login(workerLoginName, workerPassword, string.Empty, stationName);

            if (res == WorkerLoginResult.Failed)
            {
                actual = true;
            }
            Assert.AreEqual(expected, actual);
        }
Example #7
0
 public void Logout(string stationName)
 {
     Auth = new WorkerAuthenticator();
     Auth.Logout(stationName);
 }
Example #8
0
 public Authenticator(AuthenticationMode authMode, string connectionString)
 {
     this.Auth   = new WorkerAuthenticator(authMode, connectionString);
     this.Result = WorkerLoginResult.Failed;
 }
Example #9
0
 public Authenticator(AuthenticationMode authMode)
 {
     this.Auth   = new WorkerAuthenticator(authMode, this.GetConnectionString());
     this.Result = WorkerLoginResult.Failed;
 }