Translate

Wednesday, 14 November 2012

BDD with NBehave starter example

Here is a quick help for BDD with NBehave beginners.

Also refer to this presentation by me on BDD and UADD at the Agile NCR conference  - BDD and UADD with Slim

The .feature text  file that describes the scenario(s) and which gets executed by NBehave !


The ActionSteps that define the actions proposed in the .feature file above in the BDD format of Given, When, Then.


And the production class,

 public class Calculator
    {
        private int result;
        private int one, two;
        public void Enter(int o,int t)
        {
            one = o;
            two = t;
        }
        
        public void Add()
        {
            result = one + two;
        }
        public int Value() {
           return result; 
        }
    }

Below is the nbehave results



No comments: