private void Prepare()
		{
			Sharpen.IO.File file = new Sharpen.IO.File(TempFile());
			if (file.Exists())
			{
				file.Delete();
			}
			IObjectContainer testDB = OpenDB();
			DefragEncryptedFileTestCase.Item item = new DefragEncryptedFileTestCase.Item("richard"
				, 100);
			testDB.Store(item);
			testDB.Close();
		}
Beispiel #2
0
        private void Prepare()
        {
            Sharpen.IO.File file = new Sharpen.IO.File(TempFile());
            if (file.Exists())
            {
                file.Delete();
            }
            IObjectContainer testDB = OpenDB();

            DefragEncryptedFileTestCase.Item item = new DefragEncryptedFileTestCase.Item("richard"
                                                                                         , 100);
            testDB.Store(item);
            testDB.Close();
        }
Beispiel #3
0
        private void VerifyDB()
        {
            IObjectContainer testDB = OpenDB();
            IObjectSet       result = testDB.QueryByExample(typeof(DefragEncryptedFileTestCase.Item
                                                                   ));

            if (result.HasNext())
            {
                DefragEncryptedFileTestCase.Item retrievedItem = (DefragEncryptedFileTestCase.Item
                                                                  )result.Next();
                Assert.AreEqual("richard", retrievedItem.name);
                Assert.AreEqual(100, retrievedItem.value);
            }
            else
            {
                Assert.Fail("Cannot retrieve the expected object.");
            }
            testDB.Close();
        }