コード例 #1
0
        public void InitializeEntries_InvalidFile_ReturnsEmptyList()
        {
            const string pathToTestFile = "NullOrEmptyFile.json";

            var databaseAccessor = new DatabaseAccessor(pathToTestFile);

            Assert.AreEqual(new List <CalendarEntry>(), databaseAccessor.FetchEntries());
        }
コード例 #2
0
        public void AddEntry_DateIsValid_AddsEntry()
        {
            var entriesBefore = _databaseAccessor.FetchEntries().Count;

            _calendar.AddEntry("10/10/20 15:15", "Test description", "d");

            var entriesAfter = _databaseAccessor.FetchEntries().Count;

            Assert.Greater(entriesAfter, entriesBefore);
        }