Visual sutdio 2008 has the ability to automatically create unit test stubs. I have used this to create some basic unit tests, but I am confused by something:
private class bla : BaseStoreItem
{
//
}
/// <summary>
///A test for StoreData
///</summary>
public void StoreDataTestHelper<T>() where T : BaseStoreItem
{
FileStore<T> target = new FileStore<T>(); // TODO: Initialize to an appropriate value
BaseStoreItem data = new bla();
target.StoreData(data);
}
[TestMethod()]
public void StoreDataTest()
{
//Assert.Inconclusive("No appropriate type parameter is found to satisfies the type constraint(s) of T. " +
// "Please call StoreDataTestHelper<T>() with appropriate type parameters.");
StoreDataTestHelper<bla>();
}
Why do I get "Error: Cannot convert type 'StorageUnitTests.FileStoreTest.bla' to 'T'" when T is type "bla"?
I know "bla" is not a good function name, but its just an example.