コード例 #1
0
        public void GetAll_ReturnsEmptyList_RepeatCounterList()
        {
            List <RepeatCounter> newList = new List <RepeatCounter> {
            };
            List <RepeatCounter> result  = RepeatCounter.GetAll();

            CollectionAssert.AreEqual(newList, result);
        }
コード例 #2
0
        public void ClearAll_ClearAllRepeatCounters_void()
        {
            //arrange
            RepeatCounter catCounter   = new RepeatCounter("cat", "the cat and the dog are great");
            RepeatCounter dogCounter   = new RepeatCounter("dog", "the cat and the dog are great");
            RepeatCounter theCounter   = new RepeatCounter("the", "the cat and the dog are great");
            int           controlCount = 0;

            //act
            RepeatCounter.ClearAll();
            List <RepeatCounter> controlList = RepeatCounter.GetAll();
            int counterCount = controlList.Count;

            //assert
            Assert.AreEqual(controlCount, counterCount);
        }
コード例 #3
0
        public void GetAll_FetchAllCounters_List()
        {
            //arrange
            RepeatCounter        catCounter  = new RepeatCounter("cat", "the cat and the dog are great");
            RepeatCounter        dogCounter  = new RepeatCounter("dog", "the cat and the dog are great");
            RepeatCounter        theCounter  = new RepeatCounter("the", "the cat and the dog are great");
            List <RepeatCounter> controlList = new List <RepeatCounter> {
                catCounter, dogCounter, theCounter
            };

            //act
            List <RepeatCounter> result = RepeatCounter.GetAll();

            //assert
            CollectionAssert.AreEqual(result, controlList);
        }