Beispiel #1
0
        public void Execute_StepTwo_MustBeFailedAndRollbackTest()
        {
            StepTwo two = new StepTwo();

            executor.Execute(two);
            Assert.AreEqual(false, executor.Success);
        }
        private void ShowPage()
        {
            switch (StepMain.StepIndex)
            {
            case 0:
                StepOne.SetCurrentValue(VisibilityProperty, Visibility.Visible);
                StepTwo.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepThree.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepFour.SetCurrentValue(VisibilityProperty, Visibility.Hidden);

                break;

            case 1:
                StepOne.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepTwo.SetCurrentValue(VisibilityProperty, Visibility.Visible);
                StepThree.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepFour.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                break;

            case 2:
                StepOne.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepTwo.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepThree.SetCurrentValue(VisibilityProperty, Visibility.Visible);
                StepFour.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                break;

            case 3:
                StepOne.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepTwo.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepThree.SetCurrentValue(VisibilityProperty, Visibility.Hidden);
                StepFour.SetCurrentValue(VisibilityProperty, Visibility.Visible);
                break;
            }
        }
Beispiel #3
0
        private static void RunStepTwo(int min, int max, StringBuilder sOut)
        {
            string   output  = "";
            IStepTwo stepTwo = new StepTwo();

            for (int i = min; i <= max; i++)
            {
                output = RunCheckForFizzBuzz(stepTwo, i);
                output = RunCheckForNumberThree(output, stepTwo, i);

                sOut.AppendFormat("{0} ", output);
            }
        }
Beispiel #4
0
        public int AddRecipieStep2(StepTwo secondStep)
        {
            Ingredient ingredient = new Ingredient();

            ingredient.RecId  = secondStep.RecID;
            ingredient.Name   = secondStep.RecipeIngr;
            ingredient.Unit   = secondStep.DropDownVal;
            ingredient.Amount = secondStep.RecipeAmount;
            context.Ingredient.Add(ingredient);

            context.SaveChanges();

            return(ingredient.Id);
        }
Beispiel #5
0
        static void ShowResPonsibilityChainPattern()
        {
            int       num       = new Random().Next(0, 500);
            StepOne   stepOne   = new StepOne();
            StepTwo   stepTwo   = new StepTwo();
            StepThree stepThree = new StepThree();

            stepOne.SetNextStep(stepTwo);
            stepTwo.SetNextStep(stepThree);
            stepOne.InvokeHandle(new StepContext()
            {
                Number = num
            });
        }