public void ContainsTransaction_ReturnsTrue_WhenTransactionMatchesChainblockTransaction()
        {
            ITransaction transaction = CreateTransaction(1);

            chainblock.Add(transaction);

            ITransaction duplicateTransaction = CreateTransaction(1);

            Assert.That(chainblock.Contains(duplicateTransaction), Is.True);
        }
Beispiel #2
0
        public void AddThrows_When_ThereIsAlreadyATransactionWithThatId()
        {
            int          id = 1;
            ITransaction firstTransaction  = new Transaction(id, "Angel", "Pesho", 200);
            ITransaction secondTransaction = new Transaction(id, "Ivan", "Dragan", 300);

            chainblock.Add(firstTransaction);
            Assert.Throws <InvalidOperationException>(() => chainblock.Add(secondTransaction));
        }
        public void AddShouldWorkProperlyAndCountBeOne()
        {
            chainBlock.Add(validTransaction);

            Assert.AreEqual(1, chainBlock.Count);
        }