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()); }
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); }
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); }