Exemple #1
0
        public void AllProjectsShouldBeEmptyWhenNoProjectIsConfigured()
        {
            // Arrange
            var pluginRepository = Substitute.For <IPluginRepository>();
            var configuration    = new Configuration();

            var sut = new ProjectProvider(configuration, pluginRepository);

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

            // Assert
            Assert.Empty(actual);
        }
Exemple #2
0
        public void AllProjectsShouldContainEveryProjectDefinedInConfiguration()
        {
            // Arrange
            var pluginRepository = Substitute.For <IPluginRepository>();
            var configuration    = CreateConfiguration();

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

            var sut = new ProjectProvider(configuration, pluginRepository);

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

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