Example #1
0
        public void EnabledProjectsShouldNotContainDisabledProjectsDefinedInConfiguration()
        {
            // Arrange
            var pluginRepository = Substitute.For <IPluginRepository>();
            var configuration    = CreateConfiguration();

            configuration.Projects.Add(CreateProjectConfiguration("p1", false));
            configuration.Projects.Add(CreateProjectConfiguration("p2"));
            configuration.Projects.Add(CreateProjectConfiguration("p3"));

            var sut = new ProjectProvider(configuration, pluginRepository);

            // Act
            var actual = sut.EnabledProjects().ToList();

            // Assert
            Assert.Collection(actual.Select(p => p.Name),
                              x => Assert.Equal("p2", x),
                              x => Assert.Equal("p3", x)
                              );
        }