Exemple #1
0
        public void MinPlugin_AreEqual()
        {
            var plugin = new BinaryOperationPluginBuilder()
                         .Operation((x, y) => System.Math.Min(x, y))
                         .Build();

            Assert.AreEqual(2, plugin.Run(3, 2));
            Assert.AreEqual(-2, plugin.Run(10, -2));
        }
Exemple #2
0
        public void MultiplicationPlugin_AreEqual()
        {
            var plugin = new BinaryOperationPluginBuilder()
                         .Operation((x, y) => x * y)
                         .Build();

            Assert.AreEqual(9, plugin.Run(3, 3));
            Assert.AreEqual(-500, plugin.Run(10, -50));
        }
Exemple #3
0
        public void PowPlugin_AreEqual()
        {
            var plugin = new BinaryOperationPluginBuilder()
                         .Operation((x, y) => (int)System.Math.Pow(x, y))
                         .Build();

            Assert.AreEqual(9, plugin.Run(3, 2));
            Assert.AreEqual(0, plugin.Run(10, -2));
        }
        public void Add_AreEqual()
        {
            var plugin = new BinaryOperationPluginBuilder()
                         .Build();

            Plugins.Add(plugin);
            Assert.AreEqual(1, Plugins.PluginsCount);
            Plugins.Add(plugin);
            Assert.AreEqual(2, Plugins.PluginsCount);
            Plugins.Add(new [] { plugin, plugin, plugin });
            Assert.AreEqual(5, Plugins.PluginsCount);
        }