Beispiel #1
0
        public void IntervalThrowsOutsideOf100Or10000()
        {
            var journal = new FileJournal("Interval", null);

            try
            {
                Assert.Throws <ArgumentException>(() =>
                {
                    journal.JournalIntervalSeconds = 17;
                });
                Assert.Throws <ArgumentException>(() =>
                {
                    journal.JournalIntervalSeconds = 10003;
                });
                Assert.DoesNotThrow(() =>
                {
                    journal.JournalIntervalSeconds = 259;
                });
            }
            finally
            {
                journal.DeleteDatabase();
                Directory.Delete("Interval");
            }
        }
Beispiel #2
0
        public void RecordDeleteCreatesJournalEntry()
        {
            var journal = new FileJournal("Wrote", null);

            journal.JournalIntervalSeconds = 10000;

            string dir = string.Format(@"{0}\Journal", journal.DirectoryPath);

            try
            {
                Assert.AreEqual(0, Directory.GetFiles(dir).Length);
                journal.RecordDelete(1);
                Assert.AreEqual(1, Directory.GetFiles(dir).Length);
            }
            finally
            {
                journal.DeleteDatabase();
                Directory.Delete("Wrote");
            }
        }