public void NewFeature_FeatureName()
        {
            string expectedResultFeatureName = "suite name";
            string expectedResultAsA         = "user";
            string expectedResultIWant       = "to buy a car";
            string expectedResultSoThat      = "I go to the car shop";

            Console.WriteLine("NewFeature_FeatureName: 0001");
            NBehave.Narrator.Framework.Feature feature =
                UnitTestingHelper.GetNewBDDSuite(
                    expectedResultFeatureName,
                    expectedResultAsA,
                    expectedResultIWant,
                    expectedResultSoThat);
            Console.WriteLine("NewFeature_FeatureName: 0002");
            Assert.AreEqual(
                expectedResultFeatureName,
                //((NBehave.Narrator.Framework.Feature)CommonCmdletBase.UnitTestOutput[CommonCmdletBase.UnitTestOutput.Count - 1]).Title);
                feature.Title);
            Console.WriteLine("NewFeature_FeatureName: 0003");
            Assert.AreEqual(
                expectedResultAsA.ToUpper(),
                Regex.Match(feature.Narrative, @"(?<=([Aa][Ss][\s]+?[Aa][Nn]?[\s]+?)).*(?=([\,][\s]+?[Ii][\s]+?[Ww][Aa][Nn][Tt][\s]+?))").Value.ToUpper());
            Console.WriteLine("NewFeature_FeatureName: 0004");
            Assert.AreEqual(
                expectedResultIWant.ToUpper(),
                Regex.Match(feature.Narrative, @"(?<=([Ii][\s]+?[Ww][Aa][Nn][Tt][\s]+?)).*(?=([\s]+?[Ss][Oo][\s]+?[Tt][Hh][Aa][Tt][\s]+?))").Value.ToUpper());
            Console.WriteLine("NewFeature_FeatureName: 0005");
            Assert.AreEqual(
                expectedResultSoThat.ToUpper(),
                Regex.Match(feature.Narrative, @"(?<=([\s]+?[Ss][Oo][\s]+?[Tt][Hh][Aa][Tt][\s]+?)).*").Value.ToUpper());
        }
示例#2
0
        protected bool CheckInputFeature(NBehave.Narrator.Framework.Feature feature)
        {
            bool result = false;

            if (null == feature)
            {
                return(result);
                //cmdlet.writeer
            }

            if (null == (feature as NBehave.Narrator.Framework.Feature))
            {
                return(result);
            }

            result = true;

            return(result);
        }