I have the following code:
Assert.IsTrue(Repository.FindAll<string>().Count() == 0);
string newString = "New String";
Repository.Save(newString);
Assert.IsTrue(Repository.FindAll<string>().Count() == 1);
But it is failing. I suppose it has something to do with the fact that I'm saving a string.
My Save() code is this:
public void Save<T>(T obj)
{
if (obj == null)
throw new ArgumentNullException("obj not allowed to be null");
Db.Store(obj);
Db.Commit();
}
Should my persistent classes have something special? Or I can just save pretty much anything with db4o?