public void Get_By_Id_Should_Throw_An_Exception_If_Id_Is_Not_Existing() { // Arrange var chainblock = new Models.Chainblock(); // Act chainblock.Add(this.firstTransaction); // Assert Assert.Throws <InvalidOperationException>( () => chainblock.GetById(1110), // Act "This id is existing."); }
public void Get_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.GetById(-100), // Act "This id is not zero."); }
public void Get_By_Id_Should_Return_Transaction_Correctly() { // Arrange var chainblock = new Models.Chainblock(); // Act chainblock.Add(this.firstTransaction); var transaction = chainblock.GetById(10); // Assert Assert.That(transaction, Is.Not.Null); Assert.That(transaction.Id, Is.EqualTo(10)); Assert.That(transaction.From, Is.EqualTo("Ivan")); Assert.That(transaction.To, Is.EqualTo("Samuil")); Assert.That(transaction.Amount, Is.EqualTo(50)); Assert.That(transaction.Status, Is.EqualTo(TransactionStatus.Successfull)); }