Exemplo n.º 1
0
        public void EmpInitDABPVerifTestCases()
        {
            Init();

            var cases          = casesPath.XmlFileToObject <List <EmpInitDABPVerifTestCase> >();
            var notPassedCases = new List <EmpInitDABPVerifTestCase>();

            foreach (var casee in cases.Where(c => c.IsActive))
            {
                OnboardingEInfo einfo = null;
                CreateCase(casee, out einfo);

                var requestActual = EVerifyService.AssembleI9CaseFlat(einfo.Guidfield).ToBLO <EmpInitDABPVerifRequestBodyBLO>();

                switch (empInitDABPVerifTestMode)
                {
                case EmpInitDABPVerifTestMode.OfflineTestingModeRequestWriter:
                    if (!EmpInitDABPVerifRequestBodyBLO.Equals(requestActual, casee.EmpInitDABPVerifRequestExpected))
                    {
                        notPassedCases.Add(casee);
                    }

                    break;

                case EmpInitDABPVerifTestMode.OnlineRequestResponceWriter:
                    var ret = EVerifyService.CreateCase(einfo.Guidfield);
                    if (!ret)
                    {
                        notPassedCases.Add(casee);
                    }

                    casee.EmpInitDABPVerifResponce = (EmpInitVerfRespBLO)EVerifyService.LastResponce;
                    break;
                }

                casee.EmpInitDABPVerifRequestActual = requestActual;
            }

            cases.ToXmlFile(casesPath);
            Assert.IsTrue(notPassedCases.Count() == 0, "EmpInitDABPVerifRequest compare failed in TestCaseID : " + string.Join(",", notPassedCases.Select(c => c.TestCaseID).ToArray()));
        }
Exemplo n.º 2
0
        public List <EmpInitDABPVerifTestCase> EmpInitDABPVerifTestCases(Func <EmpInitDABPVerifTestCase, string> createCaseeUserMethod, string casesPath, EmpInitDABPVerifTestMode empInitDABPVerifTestMode /*, out string onboardingEinfoGuid*/)
        {
            var cases          = casesPath.XmlFileToObject <List <EmpInitDABPVerifTestCase> >();
            var notPassedCases = new List <EmpInitDABPVerifTestCase>();

            var activeCases = cases.Where(c => c.IsActive);

            foreach (var casee in activeCases)
            {
                var onboardingEinfoGuid = createCaseeUserMethod(casee);

                if (!String.IsNullOrEmpty(onboardingEinfoGuid))
                {
                    var requestActual = EVerifyService.AssembleI9CaseFlat(onboardingEinfoGuid).ToBLO <EmpInitDABPVerifRequestBodyBLO>();
                    switch (empInitDABPVerifTestMode)
                    {
                    case EmpInitDABPVerifTestMode.OfflineTestingModeRequestWriter:
                        if (!EmpInitDABPVerifRequestBodyBLO.Equals(requestActual, casee.EmpInitDABPVerifRequestExpected))
                        {
                            notPassedCases.Add(casee);
                        }
                        break;

                    case EmpInitDABPVerifTestMode.OnlineRequestResponceWriter:
                        var ret = EVerifyService.CreateCase(onboardingEinfoGuid);
                        if (!ret)
                        {
                            notPassedCases.Add(casee);
                        }
                        casee.EmpInitDABPVerifResponce = (EmpInitVerfRespBLO)EVerifyService.LastResponce;
                        break;
                    }
                    casee.EmpInitDABPVerifRequestActual = requestActual;
                }
            }
            cases.ToXmlFile(casesPath);
            return(notPassedCases);
        }