Exemplo n.º 1
0
        public void Null_values_should_not_override_existing_values(ConfigurationBuilder configurationBuilder, ObjectWithSimpleIntArray testSource)
        {
            configurationBuilder.AddObject(testSource);

            configurationBuilder.AddObject(new ObjectWithSimpleIntArray {
                Values = new int[0]
            });

            var configuration = configurationBuilder.Build();

            var result = configuration.Get <ObjectWithSimpleIntArray>();

            Assert.That(result.Values, Is.EquivalentTo(testSource.Values));
        }
Exemplo n.º 2
0
        public void Object_is_added_to_configuration(ConfigurationBuilder configurationBuilder, ObjectWithSimpleIntArray testSource)
        {
            configurationBuilder.AddObject(testSource);

            var configuration = configurationBuilder.Build();

            Assert.That(configuration[$"{nameof(testSource.Values)}:0"], Is.EqualTo($"{testSource.Values[0]}"));
        }
Exemplo n.º 3
0
        public void Object_can_be_retrieved_from_configuration(ConfigurationBuilder configurationBuilder, ObjectWithSimpleIntArray testSource)
        {
            configurationBuilder.AddObject(testSource);

            var configuration = configurationBuilder.Build();

            var result = configuration.Get <ObjectWithSimpleIntArray>();

            Assert.That(result.Values, Is.EquivalentTo(testSource.Values));
        }