Exemplo n.º 1
0
        // ----------------------------------------------------------------------------------------
        /// <!-- Summarize -->
        /// <summary>
        ///      Takes a list of results and boils it down into one summary result
        /// </summary>
        /// <returns></returns>
        public Result Summarize()
        {
            Result result = Start;

            for (int i = 0; i < Count; ++i)
            {
                result = result.And(this, i);
            }
            ResultStep step = result[0];

            step.Internal = this.Copy();


            if (StringContainsStuff(TestSequence) && StringIsNullOrWhiteSpace(step.Name))
            {
                step.Name = TestSequence;
                step.Text = "test";
            }
            result.TestSequence = TestSequence;


            Step = new List <ResultStep>();
            Append(step);
            return(this);
        }
Exemplo n.º 2
0
        public static BasicWorkflow Create(string sourceEmailAddress, string requestId, int expiresIn)
        {
            var workflow = new BasicWorkflow(
                sourceEmailAddress,
                requestId,
                expiresIn,
                new List <IWorkflowStep>
            {
                PersonalStep.Create(WorkflowSteps.Steps.Personal.ToString(), "Please tell us about yourself.", string.Empty, string.Empty, string.Empty),
                ResultStep.Create(WorkflowSteps.Steps.Result.ToString(), "Thank you for your time", false)
            });

            return(workflow);
        }
Exemplo n.º 3
0
        public static OnboardingWorkflow Create(string sourceEmailAddress, string requestId, int expiresIn)
        {
            var workflow = new OnboardingWorkflow(
                sourceEmailAddress,
                requestId,
                expiresIn,
                new List <IWorkflowStep>
            {
                PersonalStep.Create(WorkflowSteps.Steps.Personal.ToString(), "Please tell us about yourself.", string.Empty, string.Empty, string.Empty),
                WorkStep.Create(WorkflowSteps.Steps.Work.ToString(), "What do u do?", string.Empty),
                AddressStep.Create(WorkflowSteps.Steps.Address.ToString(), "Where do u live?", string.Empty, string.Empty, string.Empty, string.Empty),
                ResultStep.Create(WorkflowSteps.Steps.Result.ToString(), "Thank you for your time", false)
            });

            return(workflow);
        }
Exemplo n.º 4
0
        public static IWorkflowStep Create(string stepName, string title, FormData formData)
        {
            switch (stepName)
            {
            case "Personal":
                return(PersonalStep.Create(stepName, title, formData.FirstName, formData.LastName, formData.Email));

            case "Work":
                return(WorkStep.Create(stepName, title, formData.Work));

            case "Address":
                return(AddressStep.Create(stepName, title, formData.Street, formData.City, formData.State, formData.Zip));

            case "Result":
                return(ResultStep.Create(stepName, title, formData.IsValid));    //may be if needed we can bring this value in from db.

            default:
                throw new ArgumentOutOfRangeException(stepName, $"{stepName} is not valid.");
            }
        }
Exemplo n.º 5
0
 private Result Append(ResultStep item)
 {
     Append("", "", "", item.TestResult, item.Name, item.Text, item.Internal); return(this);
 }
Exemplo n.º 6
0
        public static ResultStep Create(string stepName, string title, bool isValid)
        {
            var step = new ResultStep(stepName, title, isValid);

            return(step);
        }