Hi Michael,
The problem that you are stating is quite strange.
I guess that there are some dependancies between the tests.
To solve tell we need your help in investigating this.
a. If you stop the rocket and run all the tests, do you get this problem?
yep.
b. Is the mocked type a System type?
nope. it's one of my own classes.
c. Do you always MockManager.Init() before each TypeMocked test?
yep.
d. Can you send me the TypeMock.out log (you can do this by setting: MockManager.LogFile=true in the first Test that is run), the file will be in the TestDriven.Net bin directory. [Showing the part from the failing test method name till the next test method is sufficiant]
here's my TypeMock'ed method:
[Test]
public void TestAuthenticateNewCustomerMock()
{
MockManager.Init();
Mock store = MockManager.Mock(typeof(Egrocer.BLL.Store));
store.ExpectAndReturn("GetStore",null);
Customer customer = new Customer();
CustomerInfo customerDetails = customer.AuthenticateCustomer(m_BadPostalCode);
Assert.IsNull(customerDetails);
Mock store2 = MockManager.Mock(typeof(Egrocer.BLL.Store));
store2.ExpectAndReturn("GetStore",new StoreInfo(StoreId,m_Name,m_Description,m_AddressId,m_MinimumOrder, m_Tax1Description, m_Tax2Description, m_PreferredAt, m_PreauthRate, m_RedeliveryCharge, m_CancellationRate, m_ElevatorFee, m_FreeDeliveries, m_SubstitutionDiscountRate, m_FreeLateChanges, m_FreeLateChangeWindow));
customerDetails = customer.AuthenticateCustomer(m_GoodPostalCode);
Assert.IsNotNull(customerDetails);
Assert.AreEqual(Egrocer.BLL.Tests.DAL.Customer.NewCustomerId,customerDetails.CustomerId);
MockManager.Verify();
}
Any other tests in this fixture that call methods that call methods on "Store" get that System.NullReferenceException.
where should i sent the TypeMock.out file?
Michael.