Exemple #1
0
 private static string Format(IFixtureStep item)
 {
     return(string.Format(
                CultureInfo.CurrentCulture,
                "[{0}(\"{1}\")]",
                item.GherkinAttribute.Name.Replace("Attribute", string.Empty),
                item.Text.Replace('\n', ' ')));
 }
Exemple #2
0
 public SpockFixture(
     IGherkinFeature gherkin,
     IFixtureInvariants fixtureInvariants,
     IFixtureStep feature,
     IEnumerable <string> comments,
     IFixtureBackground background,
     IFixtureMethods methods,
     ISpockOptions options)
     : base(options, fixtureInvariants)
 {
     this.gherkin           = gherkin;
     this.FixtureInvariants = fixtureInvariants;
     this.GherkinAttributes = feature;
     this.XmlDocComments    = new SpockCollection <string>(comments);
     this.Background        = background;
     this.FixtureMethods    = methods;
 }
        public void Add(IFixtureStep item)
        {
            if (item == null)
            {
                return;
            }

            if (item.GherkinAttribute == typeof(GivenAttribute))
            {
                this.Given    = item;
                this.HasGiven = true;
            }
            else if (item.GherkinAttribute == typeof(WhenAttribute))
            {
                this.When    = item;
                this.HasWhen = true;
            }
            else
            {
                this.Then    = item;
                this.HasThen = true;
            }
        }
 public void AddChild(IFixtureStep child)
 {
     this.children.Add(child);
 }
 public FixtureBackground(IFixtureStep background)
 {
     this.Background = background;
     this.GherkinAttribute = background.GherkinAttribute;
 }