public void TestGetLast() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5L, atom); Assert.AreEqual(0L, pair.Last); }
public void TestGetAtom() { InvPair pair = new InvPair(); Assert.IsNull(pair.Atom); pair.Atom = builder.NewAtom(ChemicalElement.C); Assert.IsNotNull(pair.Atom); }
public void TestToString() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5L, atom); Assert.IsNotNull(pair.ToString()); Assert.IsTrue(pair.ToString().Length > 0); }
public void TestSetAtomIAtom() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(); Assert.AreNotSame(atom, pair.Atom); pair.Atom = atom; Assert.AreEqual(atom, pair.Atom); }
public void TestEqualsObject() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5L, atom); Assert.AreEqual(pair, pair); Assert.AreNotSame("NotSame", pair); Assert.AreNotSame(new InvPair(), pair); }
public void TestInvPairLongIAtom() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5L, atom); Assert.IsNotNull(pair); Assert.AreEqual(5L, pair.Curr); Assert.AreEqual(atom, pair.Atom); }
public void TestSetCurrLong() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5L, atom); Assert.AreEqual(5L, pair.Curr); pair.Curr = 4L; Assert.AreEqual(4L, pair.Curr); }
public void TestCommit() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5L, atom); pair.Commit(); Assert.IsNotNull(atom.GetProperty <long>(InvPair.CanonicalLabelPropertyKey)); Assert.AreEqual(5, ((long)atom.GetProperty <long>(InvPair.CanonicalLabelPropertyKey))); }
public void TestGetPrime() { var atom = builder.NewAtom(ChemicalElement.C); InvPair pair = new InvPair(5, atom); pair.SetPrime(); int prime = pair.Prime; pair.SetPrime(); Assert.AreEqual(prime, pair.Prime, "The prime should not change when curr is not changed"); pair.Curr = 61; pair.SetPrime(); Assert.AreNotSame(prime, pair.Prime); }
public void TestSetPrime() { InvPair pair = new InvPair(); try { pair.SetPrime(); Assert.Fail("should have failed with an ArrayIndexOutOfBounds exception"); } catch (Exception) { // OK, is apparently expected to happen } }
public void TestInvPair() { InvPair pair = new InvPair(); Assert.IsNotNull(pair); }