Пример #1
0
        public void ShouldRemoveTokens()
        {
            uint blackAddCount    = 2;
            uint blueAddCount     = 1;
            uint blackRemoveCount = 1;
            uint blueRemoveCount  = 1;
            uint totalBeforeAdd   = _sut.TotalTokens;

            _sut.AddTokens(new TokenCollection(blackCount: blackAddCount, blueCount: blueAddCount));

            var totalAfterAdd = totalBeforeAdd + blackAddCount + blueAddCount;

            Assert.AreEqual(totalAfterAdd, _sut.TotalTokens);

            Assert.IsTrue(_sut.TryTake(new TokenCollection(blackCount: blackRemoveCount, blueCount: blueRemoveCount)));

            var totalAfterTake = totalAfterAdd - blackRemoveCount - blueRemoveCount;

            Assert.AreEqual(totalAfterTake, _sut.TotalTokens);
        }