public void AddCollection_NoExistingCollections_AddsCollectionConfig()
        {
            // Arrange
            var config = new DatabaseConfig
            {
                Collections = new List <CollectionConfig>()
            };

            var expected = new DatabaseConfig
            {
                Collections = new List <CollectionConfig>
                {
                    new CollectionConfig
                    {
                        CollectionName   = "name",
                        DataFileLocation = "location",
                        DropFirst        = true,
                        DataProvider     = null
                    }
                }
            };

            // Act
            config.AddCollection("name", true, "location");

            // Assert
            Assert.Equal(expected, config, Comparers.DatabaseConfigComparer());
        }
        public void AddCollection_WithNameThatAlreadyExists_ThrowsSettingsBuilderException()
        {
            // Arrange
            var config = new DatabaseConfig
            {
                Collections = new List <CollectionConfig>
                {
                    new CollectionConfig {
                        CollectionName = "name"
                    }
                }
            };

            // Act / Assert
            Assert.Throws <SettingsBuilderException>(
                () => config.AddCollection("name", true, "location"));
        }