예제 #1
0
        public void GetInstanceOfCoreObjects()
        {
            Project p   = new Project();
            IEntity ety = new MathNet.Symbolics.Core.Entity("%", new MathIdentifier("Percent", "Test"), InfixNotation.LeftAssociativeInnerOperator, 100, false);

            Signal signal = Binder.CreateSignal();

            Assert.IsNotNull(signal, "A0");
            Assert.AreEqual("MathNet.Symbolics.Core.Signal", signal.GetType().FullName, "A1");
            signal = Binder.GetSpecificInstance <Signal>(new MathIdentifier("Signal", "Core"));
            Assert.IsNotNull(signal, "A2");
            Assert.AreEqual("MathNet.Symbolics.Core.Signal", signal.GetType().FullName, "A3");

            Bus bus = Binder.CreateBus();

            Assert.IsNotNull(bus, "B0");
            Assert.AreEqual("MathNet.Symbolics.Core.Bus", bus.GetType().FullName, "B1");
            bus = Binder.GetSpecificInstance <Bus>(new MathIdentifier("Bus", "Core"));
            Assert.IsNotNull(bus, "B2");
            Assert.AreEqual("MathNet.Symbolics.Core.Bus", bus.GetType().FullName, "B3");

            Port port = Binder.CreatePort(ety);

            Assert.IsNotNull(port, "C0");
            Assert.AreEqual("MathNet.Symbolics.Core.Port", port.GetType().FullName, "C1");
            port = Binder.GetSpecificInstance <Port, IEntity>(new MathIdentifier("Port", "Core"), ety);
            Assert.IsNotNull(port, "C2");
            Assert.AreEqual("MathNet.Symbolics.Core.Port", port.GetType().FullName, "C3");
        }
        public void GetInstanceOfCoreObjects()
        {
            Project p = new Project();
            IEntity ety = new MathNet.Symbolics.Core.Entity("%", new MathIdentifier("Percent", "Test"), InfixNotation.LeftAssociativeInnerOperator, 100, false);

            Signal signal = Binder.CreateSignal();
            Assert.IsNotNull(signal, "A0");
            Assert.AreEqual("MathNet.Symbolics.Core.Signal", signal.GetType().FullName, "A1");
            signal = Binder.GetSpecificInstance<Signal>(new MathIdentifier("Signal", "Core"));
            Assert.IsNotNull(signal, "A2");
            Assert.AreEqual("MathNet.Symbolics.Core.Signal", signal.GetType().FullName, "A3");

            Bus bus = Binder.CreateBus();
            Assert.IsNotNull(bus, "B0");
            Assert.AreEqual("MathNet.Symbolics.Core.Bus", bus.GetType().FullName, "B1");
            bus = Binder.GetSpecificInstance<Bus>(new MathIdentifier("Bus", "Core"));
            Assert.IsNotNull(bus, "B2");
            Assert.AreEqual("MathNet.Symbolics.Core.Bus", bus.GetType().FullName, "B3");

            Port port = Binder.CreatePort(ety);
            Assert.IsNotNull(port, "C0");
            Assert.AreEqual("MathNet.Symbolics.Core.Port", port.GetType().FullName, "C1");
            port = Binder.GetSpecificInstance<Port, IEntity>(new MathIdentifier("Port", "Core"), ety);
            Assert.IsNotNull(port, "C2");
            Assert.AreEqual("MathNet.Symbolics.Core.Port", port.GetType().FullName, "C3");
        }