public void SaveWritesModuleSettingsToConfig() { // Arrange var notifi = new NotificationConfig { PopupEnabled = true, SoundEnabled = false, ToastsEnabled = false }; var cfg = new Mock <IConfig>(); cfg.SetupGet(c => c.Notifications).Returns(notifi); var vm = new NotificationSettings(cfg.Object); // Act vm.AvailableNotifications.First(n => n.Enabled).Enabled = false; vm.SaveTo(cfg.Object); // Assert Assert.AreEqual(false, notifi.PopupEnabled); }