public void Get_All_Senders_Should_Throw_An_Exception_If_Status_Is_Not_Existing() { // Arrange var chainblock = new Models.Chainblock(); // Act chainblock.Add(this.firstTransaction); // Assert Assert.Throws <InvalidOperationException>( () => chainblock.GetAllSendersWithTransactionStatus(TransactionStatus.Aborted), // Act "This status is existing."); }
public void Get_All_Senders_With_Transaction_Status_Should_Return_Them_Correctly() { // Arrange var chainblock = new Models.Chainblock(); // Act chainblock.Add(this.firstTransaction); this.secondTransaction = new Transaction(100, "Ivancho", "Samuilcho", 501, TransactionStatus.Successfull); chainblock.Add(this.secondTransaction); var senders = chainblock .GetAllSendersWithTransactionStatus(TransactionStatus.Successfull) .ToList(); // Assert Assert.That(senders, Is.Not.Null); Assert.That(senders[0], Is.EqualTo("Ivancho")); Assert.That(senders[1], Is.EqualTo("Ivan")); }