Example #1
0
        public void SendPackage_TestMethod()
        {
            var userName = SystemInfo.GetCurrentUserDomainName();
            var uuid     = SystemInfo.GetUUID();
            var req      = new NetRequests();
            var settings = new ConfigurationSettings();

            var hash = HashFunction.Get("SecretWord");

            var photoImg = Image.FromFile("TestImages\\goodPhotoTest.jpg");
            var scanImg  = Image.FromFile("TestImages\\scanTest.jpg");

            var data = new ArmDataPackage()
            {
                Type          = ArmDataPackageType.Preview,
                IIN           = 13543543L,
                Timestamp     = DateTime.Now,
                Comment       = "test",
                Token         = hash,
                UserName      = userName,
                WFMId         = 56789L,
                CameraPicture = photoImg.ToBase64(),
                ScanPicture   = scanImg.ToBase64()
            };
            var sendResult = req.SendPackage(data);

            Assert.IsTrue(sendResult.RequestResult == RequestResultType.Successful);
            //}
        }
Example #2
0
        public void RegisterAndGetAuth_TestMethod()
        {
            var userName  = SystemInfo.GetCurrentUserDomainName();
            var uuid      = SystemInfo.GetUUID();
            var req       = new NetRequests();
            var resultReg = req.RegisterArm(uuid, userName, "RegisterNewARM_TestMethod");

            var settings = new ConfigurationSettings();

            settings.SaveUUID(uuid);

            //settings.SaveArmGUID(Guid.NewGuid().ToString());

            var hash       = HashFunction.Get("SecretWord");
            var resultAuth = req.SetAuthRequest(userName, hash);

            if (resultAuth.RequestResult == RequestResultType.Successful)
            {
                settings.SaveArmSettings(resultAuth.Result);
            }

            Assert.AreEqual(resultReg.RequestResult, RequestResultType.Successful);
            Assert.AreEqual(resultAuth.RequestResult, RequestResultType.Successful);
            Assert.IsFalse(resultAuth.Result == null);
        }
Example #3
0
 public void Auth_TestMethod()
 {
     var req      = new NetRequests();
     var userName = SystemInfo.GetCurrentUserDomainName();
     var hash     = HashFunction.Get("SecretWord");
     var result   = req.SetAuthRequest(userName, hash);
 }
Example #4
0
        public void RegisterNewARM_TestMethod()
        {
            var userName = SystemInfo.GetCurrentUserDomainName();
            var uuid     = SystemInfo.GetUUID();
            var req      = new NetRequests();
            var ressult  = req.RegisterArm(uuid, userName, "RegisterNewARM_TestMethod");

            Assert.AreEqual(ressult.RequestResult, RequestResultType.Successful);
        }