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

            IAbsoluteLink[] buildLinks = Plugins.GetServerPluginLinks(serverSpecifier);

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

            IAbsoluteLink[] buildLinks = Plugins.GetServerPluginLinks(serverSpecifier);

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