I have been doing some research on test driven development and find it pretty cool.
One of the things I came across was that when you write your tests, there is an order of execution of your setup and test methods ([Setup] and [Test]).
Are there others that you can use while testing and if so what is the execution order of those, such as a dispose or something? I saw test fixture setup, but not too familiar with that one.
Example:
When I run the test, it does the [Setup] first and then runs the [Test] when it goes to the next test it runs the [Setup] again and then goes to the [Test].
I am using NUnit if that helps.
Here is a truncated example of what I have setup:
using NUnit.Framework;
namespace TestingProject
{
[TestFixture]
public class CustomerService_Tests
{
public string MyAccount = string.Empty;
[SetUp]
public void Setup()
{
MyAccount = "This Account";
}
[Test]
public void Validate_That_Account_Is_Not_Empty()
{
Assert.That(!string.IsNullOrEmpty(MyAccount));
}
[Test]
public void Validate_That_Account_Is_Empty()
{
Assert.That(string.IsNullOrEmpty(MyAccount));
}
}
}
So, when I run the tests, it does the setup, and then the first test, then setup and then the 2nd test.
My question is what other types can I use while testing such as [Setup] and [Test] and what is the order of execution for these.