Skip to content

Commit

Permalink
Tests for fifo max size
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho committed Jul 10, 2019
1 parent 0ac840c commit f2b516f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions neo.UnitTests/UT_FifoSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ public void FifoSetTest()
Assert.IsTrue(set.Add(c));

CollectionAssert.AreEqual(set.ToArray(), new UInt256[] { a, c });

var d = new UInt256(new byte[32] {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x02
});

// Testing Fifo max size
Assert.IsTrue(set.Add(d));
CollectionAssert.AreEqual(set.ToArray(), new UInt256[] { a, c, d });

var e = new UInt256(new byte[32] {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x03
});

Assert.IsTrue(set.Add(e));
Assert.IsFalse(set.Add(e));
CollectionAssert.AreEqual(set.ToArray(), new UInt256[] { c, d, e });
}
}
}

0 comments on commit f2b516f

Please sign in to comment.