コード例 #1
0
            public void observable_should_note_drop_a_marble_when_file_is_not_updated()
            {
                var model = new TestConfigured();

                _cut.CreateConfigFile(model);

                var observable = _cut.Get(ConfigurationResult <TestConfigured> .Create()).Observable;

                var result = observable.Capture(0.15);

                result.Should().BeNull();
            }
コード例 #2
0
            public void should_return_deserialized_config_contents()
            {
                var model = new TestConfigured();

                _cut.CreateConfigFile(model);

                var configurationResult = _cut.Get(ConfigurationResult <TestConfigured> .Create());

                configurationResult.Result.AppKey.Should().Be(model.AppKey);
                configurationResult.Result.IsEnabled.Should().Be(model.IsEnabled);
                configurationResult.Result.EnabledOn.Should().Be(model.EnabledOn);
            }
コード例 #3
0
            public void observable_should_drop_a_marble_when_file_is_updated()
            {
                var model = new TestConfigured();

                _cut.CreateConfigFile(model);

                var observable = _cut.Get(ConfigurationResult <TestConfigured> .Create()).Observable;

                var update = observable.CaptureFirst(() =>
                {
                    model.IsEnabled = false;
                    model.AppKey    = "different key";
                    model.EnabledOn = DateTime.UtcNow.AddDays(10);
                    _cut.CreateConfigFile(model);
                });

                update.AppKey.Should().Be(model.AppKey);
                update.IsEnabled.Should().Be(model.IsEnabled);
                update.EnabledOn.Should().Be(model.EnabledOn);
            }