Esempio n. 1
0
        public void TestCanActivate_NullDefinition()
        {
            AlgorithmActivator activator = new AlgorithmActivator(new TestRegistrar());
            bool canActivate             = activator.CanActivate(null);

            Assert.IsFalse(canActivate);
        }
Esempio n. 2
0
        public void TestCanActivate_NoParameterlessConstructor()
        {
            AlgorithmActivator  activator = new AlgorithmActivator(new TestRegistrar());
            AlgorithmDefinition d         = new AlgorithmDefinition("BadConstructor", null);
            bool canActivate = activator.CanActivate(d);

            Assert.IsFalse(canActivate);
        }
Esempio n. 3
0
        public void TestCanActivate_NotCached()
        {
            AlgorithmActivator  activator = new AlgorithmActivator(new TestRegistrar());
            AlgorithmDefinition d         = new AlgorithmDefinition("unknown", new Property[] { });
            bool canActivate = activator.CanActivate(d);

            Assert.IsFalse(canActivate);
        }
Esempio n. 4
0
        public void TestCanActivate_ValidDefinition()
        {
            AlgorithmActivator  activator = new AlgorithmActivator(new TestRegistrar());
            AlgorithmDefinition d         = new AlgorithmDefinition("Test",
                                                                    new Property[] { new Property("Test", typeof(double)) });
            bool canActivate = activator.CanActivate(d);

            Assert.IsTrue(canActivate);
        }