예제 #1
0
        public void AddReadAndRemoveTest()
        {
            // Align
            var facts = new FactsBase();
            var today = DateTime.Today;
            // Act and Assert
            var resultOfAdd    = facts.Add(today.DayOfWeek.ToString(), today.ToString());
            var resultOfRead   = facts.Read(today.DayOfWeek.ToString());
            var resultOfRemove = facts.Remove(today.DayOfWeek.ToString());

            // Assert
            Assert.True(resultOfAdd);
            Assert.NotNull(resultOfRead);
            Assert.True(resultOfRemove);
        }
예제 #2
0
        public void RemoveCountTest()
        {
            // Align
            var facts = new FactsBase();
            var today = DateTime.Today;
            // Act
            var resultOfAdd     = facts.Add(today.DayOfYear.ToString(), today.ToString());
            var countBefore     = facts.Count();
            var resultOfRemoval = facts.Remove(today.DayOfYear.ToString());
            var countAfter      = facts.Count();

            // Assert
            Assert.True(resultOfAdd);
            Assert.True(resultOfRemoval);
            Assert.True(countBefore > countAfter);
        }
예제 #3
0
        public void CountsTest()
        {
            // Align
            var facts = new FactsBase();
            var today = DateTime.Today;
            // Act
            var countBeforeAdd    = facts.Count();
            var resultOfAdd       = facts.Add(today.DayOfWeek.ToString(), today.ToString());
            var countAfterAdd     = facts.Count();
            var resultOfRead      = facts.Read(today.DayOfWeek.ToString());
            var countAfterRead    = facts.Count();
            var resultOfRemoval   = facts.Remove(today.DayOfWeek.ToString());
            var countAfterRemoval = facts.Count();

            // Assert
            Assert.True(resultOfAdd);
            Assert.NotNull(resultOfRead);
            Assert.True(resultOfRemoval);
            Assert.NotEqual(countBeforeAdd, countAfterAdd);
            Assert.NotEqual(countAfterRead, countAfterRemoval);
            Assert.Equal(countBeforeAdd, countAfterRemoval);
            Assert.Equal(countAfterAdd, countAfterRead);
        }