Exemplo n.º 1
0
        public void ShouldUseInitialStoreWhenSettingASetting()
        {
            var innerStore = new Mock <ISettingsStore>();
            var store      = new InvalidatableSettingsStore(innerStore.Object, oldStore => oldStore);

            store.SetSetting(Namespace, SettingName, null);
            innerStore.Verify(
                s => s.SetSetting(It.IsAny <SettingsNamespace>(), It.IsAny <string>(), It.IsAny <object>()),
                Times.AtLeastOnce());
        }
Exemplo n.º 2
0
        public void ShouldUseStoreFromInvalidatorAfterInvalidationWhenSettingASetting()
        {
            var innerStore = new Mock <ISettingsStore>();
            var store      = new InvalidatableSettingsStore(null, oldStore => innerStore.Object);

            store.Invalidate();
            store.SetSetting(Namespace, SettingName, null);

            innerStore.Verify(
                s => s.SetSetting(It.IsAny <SettingsNamespace>(), It.IsAny <string>(), It.IsAny <object>()),
                Times.AtLeastOnce());
        }