Example #1
0
        public void Change_Transaction_By_Id_Status_Should_Throw_An_Exception_If_Id_Is_Under_Zero()
        {
            // Arrange
            var chainblock = new Models.Chainblock();

            // Act
            chainblock.Add(this.firstTransaction);

            // Assert
            Assert.Throws <ArgumentOutOfRangeException>(
                () => chainblock.ChangeTransactionStatus(-10, TransactionStatus.Aborted), // Act
                "Id is not under zero.");
        }
Example #2
0
        public void Change_Transaction_By_Id_Status_Should_Throw_An_Exception_If_Id_Is_Not_Found()
        {
            // Arrange
            var chainblock = new Models.Chainblock();

            // Act
            chainblock.Add(this.firstTransaction);

            // Assert
            Assert.Throws <InvalidOperationException>(
                () => chainblock.ChangeTransactionStatus(78, TransactionStatus.Aborted), // Act
                "Id is existing.");
        }
Example #3
0
        public void Change_Transaction_By_Id_Status_Should_Change_Status_Correctly()
        {
            // Arrange
            var chainblock = new Models.Chainblock();

            // Act
            chainblock.Add(this.firstTransaction);

            chainblock.ChangeTransactionStatus(10, TransactionStatus.Aborted);

            var actualStatus   = this.firstTransaction.Status;
            var expectedStatus = TransactionStatus.Aborted;

            // Assert
            Assert.That(actualStatus, Is.EqualTo(expectedStatus));
        }