Ejemplo n.º 1
0
        public void LastActivityFailedName()
        {
            //Arrange
            ValueExpression VE = new ValueExpression(mEnv, mBF);

            VE.Value = "{FD Object=LastFailedActivity Field=ActivityName}";
            GingerCore.Activity activity = new GingerCore.Activity();
            activity.Active       = true;
            activity.ActivityName = "Activity2";
            ActDummy dummy1 = new ActDummy();

            dummy1.Active      = true;
            dummy1.Description = "Dummy action";
            activity.Acts.Add(dummy1);
            mBF.AddActivity(activity);
            mAct.ActReturnValues.Add(new ActReturnValue()
            {
                Active = true, Actual = "a", Expected = "b"
            });

            //Act
            runner.RunRunner();
            string v = VE.ValueCalculated;

            //Assert
            Assert.AreEqual(v, "Activity1");
        }
Ejemplo n.º 2
0
        public void PreviousActivityName()
        {
            //Arrange
            GingerCore.Activity activity = new GingerCore.Activity();
            activity.ActivityName = "Activity2";
            activity.Active       = true;
            ActDummy dummy = new ActDummy();

            dummy.Active = true;
            dummy.Value  = "{FD Object=PreviousActivity Field=ActivityName}";
            activity.Acts.Add(dummy);
            mBF.AddActivity(activity);

            //Act
            runner.RunRunner();
            string v = dummy.ValueForDriver;

            //Assert
            Assert.AreEqual(v, "Activity1");
        }
Ejemplo n.º 3
0
        public void ErrorHandlerActionName()
        {
            //Arrange
            ValueExpression VE = new ValueExpression(mEnv, mBF);

            VE.Value = "{FD Object=ErrorHandlerOriginAction Field=Description}";
            GingerCore.Activity activity = new GingerCore.Activity();
            activity.Active       = true;
            activity.ActivityName = "Error Handler Activity";
            ActDummy dummy1 = new ActDummy();

            dummy1.Active      = true;
            dummy1.Description = "Dummy action";
            dummy1.ActReturnValues.Add(new ActReturnValue()
            {
                Active = true, Actual = "a", Expected = "b"
            });
            activity.Acts.Add(dummy1);
            activity.ErrorHandlerMappingType = eHandlerMappingType.AllAvailableHandlers;
            mBF.AddActivity(activity);
            ErrorHandler errorHandler = new ErrorHandler();

            errorHandler.Active = true;
            ActDummy dummy = new ActDummy();

            dummy.Active      = true;
            dummy.Description = "Error Handler Dummy action";
            errorHandler.Acts.Add(dummy);
            mBF.AddActivity(errorHandler);

            //Act
            runner.RunRunner();
            string v = VE.ValueCalculated;

            //Assert
            Assert.AreEqual(v, "Dummy action");
        }
Ejemplo n.º 4
0
        public void TestInitialize()
        {
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            mSolutionRepository = WorkSpace.Instance.SolutionRepository;
            string TempRepositoryFolder = TestResources.GetTestTempFolder(Path.Combine("Solutions", "temp"));

            mSolutionRepository.Open(TempRepositoryFolder);
            Ginger.SolutionGeneral.Solution sol = new Ginger.SolutionGeneral.Solution();
            sol.ContainingFolderFullPath = TempRepositoryFolder;
            WorkSpace.Instance.Solution  = sol;
            mSolutionRepository.StopAllRepositoryFolderWatchers();

            WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder = Path.Combine(TempRepositoryFolder, "ExecutionResults");

            runset      = new RunSetConfig();
            runset.Name = "NewRunset1";
            WorkSpace.Instance.RunsetExecutor.RunSetConfig = runset;
            runner                 = new GingerRunner();
            runner.Name            = "Runner1";
            runner.CurrentSolution = new Ginger.SolutionGeneral.Solution();
            WorkSpace.Instance.RunsetExecutor.Runners.Add(runner);
            mEnv      = new ProjEnvironment();
            mEnv.Name = "Environment1";
            EnvApplication app1 = new EnvApplication();

            app1.Name = "App1";
            app1.Url  = "URL123";
            mEnv.Applications.Add(app1);
            GeneralParam GP1 = new GeneralParam();

            GP1.Name  = "GP1";
            GP1.Value = "GP1Value";
            app1.GeneralParams.Add(GP1);

            mBF      = new BusinessFlow();
            mBF.Name = "Businessflow1";
            runner.BusinessFlows.Add(mBF);
            mActivity              = new GingerCore.Activity();
            mActivity.Active       = true;
            mActivity.ActivityName = "Activity1";
            mAct             = new ActDummy();
            mAct.Active      = true;
            mAct.Description = "Action1";
            mActivity.Acts.Add(mAct);
            mActivity.Acts.CurrentItem = mAct;
            mBF.AddActivity(mActivity);


            BusinessFlow BF1 = new BusinessFlow();

            BF1.Name = "Businessflow2";
            runner.BusinessFlows.Add(BF1);
            GingerCore.Activity activity = new GingerCore.Activity();
            activity.Active       = true;
            activity.ActivityName = "Activity1";
            ActDummy dummy = new ActDummy();

            dummy.Active      = true;
            dummy.Description = "Dummy1";
            activity.Acts.Add(dummy);
            activity.Acts.CurrentItem = dummy;
            BF1.AddActivity(activity);
        }