I installed the demo license and I try to understand how it work and if it will be useful for our product, but all tests doesn't run well.
I begin with the Natural Mocks and running with debugger each test to understand the possibility but no test in Test4 will works. I always see the Demo warning saying that the Demo only allow to Mock once.
This is the first test of the Test4_Instances.cs and the line in bold throw the exception.
Test4_Instance.cs:46
/// <summary>
/// We will test mocking instance
/// </summary>
[Test]
public void MockFutureInstanceOfProduct()
{
// Start Mocking
using (RecordExpectations recorder = new RecordExpectations())
{
// Let mock the product - this will mock the next invocation of Product,
Product mockProduct = new Product(); // <== This line throws the exception
// it will mock constructors too so our price will be 0
}
// END OF MOCK SETUP
// The GetProduct will call new Product so this product is mocked
IProduct product = ProductFactory.GetProduct("name");
// Just check that price is now 0;
Assert.AreEqual(0F,product.Price);
// Lets call it again - this time a new instance will be made that is not mocked
IProduct product2 = ProductFactory.GetProduct("other");
// Just check that price is now 10;
Assert.AreEqual(10.0F,product2.Price);
}
I didn't change anything. I used VS2005 with TestDriven.net to run test. All previous test worked well.
What can I do to try all the feature with the demo license ?
Thanks.