public void AddTest() { BddGCache target = new BddGCache(); int u1 = 4; int u2 = 5; Op op = Op.DIS; int u = 0; target.Add(u1, u2, op, u); BddSharp_Kernel_BddGCacheAccessor accessor = new BddSharp_Kernel_BddGCacheAccessor(target); BddGCacheEntry[] temp = accessor.cacheArray; bool result = false; foreach (BddGCacheEntry en in temp) { if (en.op == op && en.u1 == u1 && en.u2 == u2) { result = true; break; } } Assert.AreEqual(true, result); }
public void ItemTest() { BddGCache target = new BddGCache(); int u1 = 45; int u2 = 876; Op op = Op.INV_IMPL; int u = 647; target.Add(u1, u2, op, u); Assert.AreEqual(u, target[u1, u2, op], "BddSharp.Kernel.BddGCache.this was not set correctly."); }
public void ContainsKeyTest() { BddGCache target = new BddGCache(); int u1 = 45; int u2 = 876; Op op = Op.INV_IMPL; int u = 647; target.Add(u1, u2, op, u); bool expected = true; bool actual; actual = target.ContainsKey(u1, u2, op); Assert.AreEqual(expected, actual, "BddSharp.Kernel.BddGCache.ContainsKey did not return the expected value."); Assert.IsFalse(target.ContainsKey(2, 4, Op.NAND)); }