Exemple #1
0
        public void IsCompleted()
        {
            Card card = new Card();
            while (card.GroupId < Card.PointsForComplete) {
                Assert.IsFalse(card.IsComplete());
                card.GivePoint();
            }

            Assert.IsTrue(card.IsComplete());

            card.GivePoint();
            Assert.IsTrue(card.IsComplete());
        }
Exemple #2
0
        public void ResetPoints()
        {
            Card card = new Card();
            Assert.DoesNotThrow(card.ResetPoints);
            Assert.AreEqual(0, card.Points);
            Assert.AreEqual(0, card.GroupId);

            while (card.GroupId == 0)
                card.GivePoint();
            var cardDate = card.GroupChangeDate;

            card.ResetPoints();
            Assert.AreEqual(0, card.Points);
            Assert.AreEqual(0, card.GroupId);
            Assert.AreNotEqual(cardDate, card.GroupChangeDate);
        }
Exemple #3
0
        public void GivePoint()
        {
            Card card = new Card { TargetPoints = 2 };
            DateTime initialDate = card.GroupChangeDate;

            Assert.AreEqual(0, card.Points);
            Assert.AreEqual(0, card.GroupId);
            Assert.AreEqual(initialDate, card.GroupChangeDate);

            card.GivePoint();
            Assert.AreEqual(1, card.Points);
            Assert.AreEqual(0, card.GroupId);
            Assert.AreEqual(initialDate, card.GroupChangeDate);

            card.GivePoint();
            Assert.AreEqual(0, card.Points);
            Assert.AreEqual(1, card.GroupId);
            Assert.Greater(card.GroupChangeDate, initialDate);
        }