Esempio n. 1
0
        public static void CreateNewFeature(BDDFeatureCmdletBase cmdlet)
        {
            ScenarioProcessingClass scenarioClass =
                new ScenarioProcessingClass();

            scenarioClass.SetupFeature(
                cmdlet.FeatureName,
                cmdlet.AsA,
                cmdlet.IWant,
                cmdlet.SoThat);

            scenarioClass.MainSetup();

            BDDAddinData.Features.Add(scenarioClass);

            cmdlet.WriteObject(cmdlet, scenarioClass.FeatureCreated);
        }
Esempio n. 2
0
        public static NBehave.Narrator.Framework.Feature GetNewBDDSuite(
            string featureName,
            string asA,
            string iWant,
            string soThat)
        {
            //throw new NotImplementedException();

            //            NewSuiteCmdletBase cmdlet =
            //                new NewSuiteCmdletBase();
            //            //cmdlet.UnitTestMode = true;
            //            if (null != name && string.Empty != name) {
            //                cmdlet.Name = name;
            //            }
            //            if (null != id && string.Empty != id) {
            //                cmdlet.Id = id;
            //            }
            //            if (null != description && string.Empty != description) {
            //                cmdlet.Description = description;
            //            }
            //
            //            TMXNewTestSuiteCommand command =
            //                new TMXNewTestSuiteCommand(cmdlet);
            //            command.Execute();
            //
            //            return (ITestSuite)CommonCmdletBase.UnitTestOutput[CommonCmdletBase.UnitTestOutput.Count - 1];

            BDDFeatureCmdletBase cmdlet =
                new BDDFeatureCmdletBase();
            cmdlet.FeatureName = featureName;
            cmdlet.AsA = asA;
            cmdlet.IWant = iWant;
            cmdlet.SoThat = soThat;

            BDDNewFeatureCommand command =
                new BDDNewFeatureCommand(cmdlet);
            command.Execute();

            //return ((NBehave.Narrator.Framework.Feature)CommonCmdletBase.UnitTestOutput[CommonCmdletBase.UnitTestOutput.Count - 1]);
            Console.WriteLine("GetNewBDDSuite: 0001");
            try {
            Console.WriteLine(((NBehave.Narrator.Framework.Feature)(object)PSTestLib.UnitTestOutput.LastOutput[0]));
            }
            catch (Exception e00) {
            Console.WriteLine(e00.Message);
            Console.WriteLine(e00.GetType().Name);
            }
            try {
            Console.WriteLine(((NBehave.Narrator.Framework.Feature)(object)PSTestLib.UnitTestOutput.Count));
            }
            catch (Exception e01) {
            Console.WriteLine(e01.Message);
            Console.WriteLine(e01.GetType().Name);
            }
            try {
            Console.WriteLine(((NBehave.Narrator.Framework.Feature)(object)PSTestLib.UnitTestOutput.LastOutput[0]));
            }
            catch (Exception e02) {
            Console.WriteLine(e02.Message);
            Console.WriteLine(e02.GetType().Name);
            }
            return ((NBehave.Narrator.Framework.Feature)(object)PSTestLib.UnitTestOutput.LastOutput[0]);
            Console.WriteLine("GetNewBDDSuite: 0002");
        }