Example #1
0
        public void Remove_Transaction_By_Id_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.RemoveTransactionById(-10), // Act
                "Id is not under zero.");
        }
Example #2
0
        public void Remove_Transaction_By_Id_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.RemoveTransactionById(78), // Act
                "Id is existing.");
        }
Example #3
0
        public void Remove_Transaction_By_Id_Should_Be_Removed_Correctly()
        {
            // Arrange
            var chainblock = new Models.Chainblock();

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

            chainblock.RemoveTransactionById(10);

            var actualCount   = chainblock.Count;
            var expectedCount = 0;

            // Assert
            Assert.That(actualCount, Is.EqualTo(expectedCount));
        }