Exemplo n.º 1
0
        public void creates_empty_settings()
        {
            // ARRANGE
            var service = new SettingsService(_schedulerService);

            // ACT
            var settings = service.CreateOrUpdate("Settings.1");

            // ASSERT
            Assert.That(settings, Is.Empty);
        }
Exemplo n.º 2
0
        public void returns_null_for_invalid_settings()
        {
            // ARRANGE
            var service = new SettingsService(_schedulerService);

            // ACT
            var settings1 = service.CreateOrUpdate("Settings.1");

            settings1["Test.1"] = "1";

            ISettings settings2;
            var       result = service.TryGet("Settings.2", out settings2);

            _testScheduler.AdvanceBy(TimeSpan.FromSeconds(1));

            // ASSERT
            Assert.That(result, Is.False);
            Assert.That(settings2, Is.Null);
        }
Exemplo n.º 3
0
        public void updates_settings()
        {
            // ARRANGE
            var service = new SettingsService(_schedulerService);

            // ACT
            var settings1 = service.CreateOrUpdate("Settings.1");

            settings1["Test.1"] = "1";

            ISettings settings2;
            var       result = service.TryGet("Settings.1", out settings2);

            _testScheduler.AdvanceBy(TimeSpan.FromSeconds(1));

            // ASSERT
            Assert.That(result, Is.True);
            Assert.That(settings2, Is.Not.Empty);
        }