Skip to content

Commit

Permalink
allow to check multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Feb 20, 2024
1 parent 2d2ebb4 commit 2947635
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Neo.SmartContract.Testing/TestingStandards/Nep17Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Neo.VM;
using Neo.VM.Types;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace Neo.SmartContract.Testing.TestingStandards;
Expand Down Expand Up @@ -71,6 +72,21 @@ public void AssertTransferEvent(UInt160? from, UInt160? to, BigInteger? amount)
raisedTransfer.Clear();
}

/// <summary>
/// Assert that Transfer event was raised
/// </summary>
/// <param name="from">From</param>
/// <param name="to">To</param>
/// <param name="amount">Amount</param>
public void AssertTransferEvent(UInt160?[] from, UInt160?[] to, BigInteger?[] amount)
{
Assert.AreEqual(from.Length, raisedTransfer.Count);
CollectionAssert.AreEqual(raisedTransfer.Select(u => u.from).ToArray(), from);
CollectionAssert.AreEqual(raisedTransfer.Select(u => u.to).ToArray(), to);
CollectionAssert.AreEqual(raisedTransfer.Select(u => u.amount).ToArray(), amount);
raisedTransfer.Clear();
}

/// <summary>
/// Assert that Transfer event was NOT raised
/// </summary>
Expand Down

0 comments on commit 2947635

Please sign in to comment.