Exemplo n.º 1
0
        public void Addition2(int x, int y, int expectedAnswer, Calculator calculator, int answer)
        {
            "Given the number 2"
                .f(() => x = 2);

            "And the number {1}"
                .f(() => y = 3);

            "And a calculator"
                .f(() => calculator = new Calculator());

            "When I add the numbers together"
                .f(() => answer = calculator.Add(x, y));

            "Then the answer is 5"
                .f(() => Assert.Equal(5, answer));
        }
Exemplo n.º 2
0
 public XUnit()
 {
     this.testee = new Calculator();
 }