public void ShouldReturnFarmPluginLinksByQueryingConfiguration()
        {
            configurationMock.SetupGet(_configuration => _configuration.FarmPlugins).Returns(new IPlugin[] { (IPlugin)pluginMock1.Object, (IPlugin)pluginMock2.Object }).Verifiable();
            linkFactoryMock.Setup(factory => factory.CreateFarmLink("Description 1", "Action Name 1")).Returns(link1).Verifiable();
            linkFactoryMock.Setup(factory => factory.CreateFarmLink("Description 2", "Action Name 2")).Returns(link2).Verifiable();

            IAbsoluteLink[] buildLinks = Plugins.GetFarmPluginLinks();

            Assert.AreSame(link1, buildLinks[0]);
            Assert.AreSame(link2, buildLinks[1]);
            Assert.AreEqual(2, buildLinks.Length);
            VerifyAll();
        }
Exemple #2
0
        public void ShouldReturnFarmPluginLinksByQueryingConfiguration()
        {
            configurationMock.ExpectAndReturn("FarmPlugins", new IPlugin[] { (IPlugin)pluginMock1.MockInstance, (IPlugin)pluginMock2.MockInstance });
            linkFactoryMock.ExpectAndReturn("CreateFarmLink", link1, "Description 1", "Action Name 1");
            linkFactoryMock.ExpectAndReturn("CreateFarmLink", link2, "Description 2", "Action Name 2");

            IAbsoluteLink[] buildLinks = Plugins.GetFarmPluginLinks();

            Assert.AreSame(link1, buildLinks[0]);
            Assert.AreSame(link2, buildLinks[1]);
            Assert.AreEqual(2, buildLinks.Length);
            VerifyAll();
        }