コード例 #1
0
        public void DatabaseDeleteRecord()
        {
            int record;

            record = DatabaseStoreStatic.NewRecord("test");
            DatabaseStoreStatic.SetField(record, "author", "first author");
            DatabaseStoreStatic.SetFilename(record, "file://testuri");
            Assert.DoesNotThrow(() => DatabaseStoreStatic.GetKey(record));
            Assert.AreEqual("test", DatabaseStoreStatic.GetKey(record));
            Assert.DoesNotThrow(() => DatabaseStoreStatic.GetField(record, "author"));
            Assert.AreEqual("first author", DatabaseStoreStatic.GetField(record, "author"));
            Assert.AreEqual("file://testuri", DatabaseStoreStatic.GetFilename(record));
            DatabaseStoreStatic.DeleteRecord(record);
            Assert.Throws <NoResultException> (() => DatabaseStoreStatic.GetKey(record));
            Assert.AreEqual("", DatabaseStoreStatic.GetFilename(record));
            Assert.AreEqual("", DatabaseStoreStatic.GetField(record, "author"));
        }