예제 #1
0
        //private void UserGeneralInfo_AltLastName_Test()
        //{
        //    var watch = new Stopwatch();
        //    watch.Start();
        //    var resultReport = new ResultReport(this.UserId, this.OldId, EnumTestUnitNames.UserGeneralInfo_AltLastName, "Comparing AltLastName (if needed)");

        //    string oldValue = ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.lastname.ToString());
        //    var compareStrategy = new CompareStrategyFactory(oldValue, HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(newData.LastName)), resultReport);
        //    compareStrategy.Investigate();

        //    if(resultReport.Severity != EnumResultSeverityType.SUCCESS)
        //    {
        //        resultReport = new ResultReport(this.UserId, this.OldId, EnumTestUnitNames.UserGeneralInfo_AltLastName, "Comparing AltLastName (if needed)");

        //        oldValue = ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.lastname.ToString());
        //        compareStrategy = new CompareStrategyFactory(oldValue, HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(newData.AltLastName)), resultReport);
        //        compareStrategy.Investigate();
        //    }

        //    watch.Stop();
        //    resultReport.Duration = watch.Elapsed;

        //    this.DetailedResults.Add(resultReport.TestName, resultReport);

        //    LogManager.Instance.LogTestResult(this.Container.BuildOldServiceFullURL(this.OldId),
        //                                      this.BuildNewServiceURL(this.PageName),
        //                                      resultReport);
        //}

        private void UserGeneralInfo_JobClass_Test()
        {
            var watch = new Stopwatch();

            watch.Start();
            var resultReport = new ResultReport(this.UserId, this.OldId, EnumTestUnitNames.UserGeneralInfo_JobClass, "Checking Job Class assigned");

            //make sure test is okay if value assigned and fails if no value
            string oldValue        = (!string.IsNullOrEmpty(newData.JobClass) ? "1":string.Empty);
            var    compareStrategy = new CompareStrategyFactory(oldValue, HttpUtility.HtmlEncode(HttpUtility.HtmlDecode((!string.IsNullOrEmpty(newData.JobClass) ? "1" : "0"))), resultReport);

            compareStrategy.Investigate();

            watch.Stop();
            resultReport.Duration = watch.Elapsed;

            this.DetailedResults.Add(resultReport.TestName, resultReport);

            LogManager.Instance.LogTestResult(this.Container.BuildOldServiceFullURL(this.OldId),
                                              this.BuildNewServiceURL(this.PageName),
                                              resultReport);
        }
예제 #2
0
        private void UserGeneralInfo_Organization_IdAndNameTogether_Test(OrganizationTreeDescriptor oldTreeRoot, OrganizationTreeDescriptor newTreeRoot)
        {
            var watch = new Stopwatch();

            watch.Start();
            var resultReport    = new ResultReport(this.UserId, this.OldId, EnumTestUnitNames.UserGeneralInfo_Organizations_IdAndName, "Comparing Organization Id+Name Combinations");
            var compareStrategy = new CompareStrategyFactory(
                oldServiceOrganizationDescriptors,
                oldTreeRoot,
                newServiceOrganizationDescriptors,
                newTreeRoot,
                resultReport);

            compareStrategy.Investigate();

            watch.Stop();
            resultReport.Duration = watch.Elapsed;

            this.DetailedResults.Add(resultReport.TestName, resultReport);

            LogManager.Instance.LogTestResult(this.Container.BuildOldServiceFullURL(this.OldId),
                                              this.BuildNewServiceURL(this.PageName),
                                              resultReport);
        }