Exemple #1
0
        public void Any()
        {
            RingMembershipAtom matcher = new RingMembershipAtom(-1, new Mock <IChemObjectBuilder>().Object);
            var   mock_atom            = new Mock <IAtom>();
            IAtom atom = mock_atom.Object;

            mock_atom.Setup(n => n.GetProperty <SMARTSAtomInvariants>(SMARTSAtomInvariants.Key)).Returns(
                new SMARTSAtomInvariants(new Mock <IAtomContainer>().Object, 0, 5,
                                         Array.Empty <int>(), 2, 0, 0, 0));
            Assert.IsTrue(matcher.Matches(atom));
        }
        public void Mismatches()
        {
            RingMembershipAtom matcher = new RingMembershipAtom(2);
            var   mock_atom            = new Mock <IAtom>();
            IAtom atom = mock_atom.Object;

            mock_atom.Setup(n => n.GetProperty <SMARTSAtomInvariants>(SMARTSAtomInvariants.Key)).Returns(
                new SMARTSAtomInvariants(
                    new Mock <IAtomContainer>().Object, 0, 1,
                    Array.Empty <int>(), 0, 0, 0, 0));
            Assert.IsFalse(matcher.Matches(atom));
        }