Beispiel #1
0
        public void CircuitNodeFactory_Encoder_Positive()
        {
            TestHelper.SetTestPaths();
            INodeFactory factory = new CircuitNodeFactory();

            INode node = factory.GetNode("testName", "ENCODER");

            Assert.AreEqual(true, node is CircuitNode);
            Assert.AreEqual(true, node is IMultipleInputs);
            Assert.AreEqual(false, node is ISingleInput);
            Assert.AreEqual("testName", node.Name);
            Assert.AreEqual("ENCODER.txt", ((CircuitNode)node).Circuit.Name);
        }
Beispiel #2
0
        private CircuitNode GetCalcCircuit()
        {
            string filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            Validator.InternalCircuitNamesForTests = new string[] {
                "INPUT_HIGH", "INPUT_LOW", "PROBE", "NAND", "OR", "AND", "NOT", "CALC", "DECODER", "ENCODER", "DECODER_ENABLABLE", "FULLADDER"
            };

            CircuitNodeFactory.DifferentPathForTests = filePath + "../../../../Internal_Circuits/";

            INodeFactory factory = new CircuitNodeFactory();

            return((CircuitNode)factory.GetNode("testName", "CALC"));
        }