Exemple #1
0
        public void Test_BuildFromOptionalSources_ConfigAJson_Ok()
        {
            // Arrange
            var expected = new ConfigA("Config1", 2, true);

            var source = new ConfigurationSource <ConfigA>(
                Environment.Default,
                FileType.Json,
                false
                );

            // Act
            var actual = new ConfigA();

            this.Builder
            .Register(
                source,
                source.With(Environment.Production).With(true)
                )
            .Build()
            .GetSection(nameof(ConfigA))
            .Bind(actual);

            // Assert
            expected.AssertWith(actual);
        }