Test Driven Development - Should my bowl variable keep increasing?

I noticed that with in each test my bowl variable keeps increasing.

For example:

  1. At the end of the Strike test the variable is 2.
  2. Then it tests if a single bowl is not a strike then it excutes a tidy. At the end of this test bowl = 3.
  3. Then we test for a spare and at the end of this test the bowl variable is 5.

My question is: Is this expected behavior? In the video Ben has only one line in T02_Bowl8_ReturnsTidy. It seems in my project I need to add a actionMaster.Bowl(#); to make all other tests pass.

public void T02_Bowl8_ReturnsTidy()
    Assert.AreEqual(tidy, actionMaster.Bowl(8));

I discovered the answer. It is not expected behavior. My setup function was tagged as [Test] Once I changed it to [SetUp]. everything worked.

1 Like

Privacy & Terms