Exemplo n.º 1
0
        public void InfeasibleTerminalCount()
        {
            VFSubState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            Assert.IsTrue(state.Feasible(0, 0)); // 0,0 is feasible
                                                 // XXX: depends on molecule order not changing
            state.t1[1] = 1;
            state.t1[5] = 1;
            Assert.IsFalse(state.Feasible(0, 0)); // 0,0 is infeasible
        }
Exemplo n.º 2
0
        public void InfeasibleAtoms()
        {
            var m = new Mock <AtomMatcher>(); AtomMatcher mock = m.Object;

            m.Setup(n => n.Matches(It.IsAny <IAtom>(), It.IsAny <IAtom>())).Returns(false);
            VFSubState state = CreateBenzeneToNaphthalene(mock, new Mock <BondMatcher>().Object);

            for (int i = 0; i < state.NMax(); i++)
            {
                for (int j = 0; j < state.MMax(); j++)
                {
                    Assert.IsFalse(state.Feasible(i, j));
                }
            }
        }
Exemplo n.º 3
0
        public void InfeasibleBonds()
        {
            var m = new Mock <BondMatcher>(); BondMatcher mock = m.Object;

            m.Setup(n => n.Matches(It.IsAny <IBond>(), It.IsAny <IBond>())).Returns(false);
            VFSubState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), mock);

            state.m1[0] = 0;
            state.m1[1] = 1;
            state.m1[2] = 2;
            state.m1[3] = 3;
            state.m1[4] = 4;
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    Assert.IsFalse(state.Feasible(i, j));
                }
            }
        }