예제 #1
0
        public void WhenBaseKeyIsEmpty_SettingsAreEmpty()
        {
            var baseKey    = hkcu.CreateSubKey(TestKeyPath);
            var repository = new InventorySettingsRepository(baseKey);

            var settings = repository.GetSettings();

            Assert.IsNull(settings.Username);
            Assert.IsNull(settings.Password);
            Assert.IsNull(settings.Domain);
        }
예제 #2
0
        public void WhenSettingsSaved_GetSettingsReturnsData()
        {
            var baseKey    = hkcu.CreateSubKey(TestKeyPath);
            var repository = new InventorySettingsRepository(baseKey);

            var originalSettings = new InventorySettings()
            {
                Username = "******"
            };

            repository.SetSettings(originalSettings);

            var settings = repository.GetSettings();

            Assert.AreEqual(originalSettings.Username, settings.Username);
        }