public void GetByTransactionStatusShouldThrowWhenNoTransactionsWithSuchStatus()
        {
            chainBlock.Add(new Transaction(1, TransactionStatus.Aborted, "Pesho", "Gosho", 300.0));
            chainBlock.Add(new Transaction(2, TransactionStatus.Unauthorized, "Ana", "Mara", 300.0));

            Assert.Throws <InvalidOperationException>(() => chainBlock.GetByTransactionStatus(TransactionStatus.Successfull));
        }
Esempio n. 2
0
        public void GetByTransactionStatusThrows_When_ThereAreNotTransactionsWithThatStatus()
        {
            ITransaction successfullTransaction = new Transaction(1, "A", "B", 200);

            successfullTransaction.Status = TransactionStatus.Successfull;
            ITransaction failedTransaction = new Transaction(2, "C", "D", 100);

            failedTransaction.Status = TransactionStatus.Failed;
            ITransaction unauthorizedTransaction = new Transaction(3, "E", "F", 300);

            unauthorizedTransaction.Status = TransactionStatus.Unauthorized;

            chainblock.Add(successfullTransaction);
            chainblock.Add(failedTransaction);
            chainblock.Add(unauthorizedTransaction);

            Assert.Throws <InvalidOperationException>(() => chainblock.GetByTransactionStatus(TransactionStatus.Aborted));
        }