public void RssFeedViewModel_WelcomeSettingsHelperReturnsTrue_RssFeedIsOpen_TitleBarIsRed_IconIsArrow() { _welcomeSettingsHelper.CheckIfRequiredAndSetCurrentVersion().Returns(true); var vm = BuildViewModel(); var tbc = vm.TitleBarColor.GetCurrentValueAsFrozen().ToString(); var expectedColor = "#ffc5091d"; // the nuance of red we use for the title bar Assert.IsTrue(vm.RssFeedIsOpen); Assert.AreEqual(tbc, expectedColor.ToUpper()); Assert.IsTrue(vm.RssFeedIcon == IconList.RssFeedArrowIcon); }
public RssFeedViewModel(ICommandLocator commandLocator, ICurrentSettings <Conversion.Settings.RssFeed> rssFeedSettingsProvider, IGpoSettings gpoSettings, ITranslationUpdater translationUpdater, IWelcomeSettingsHelper welcomeSettingsHelper, IRssService rssService) : base(translationUpdater) { _rssFeedSettingsProvider = rssFeedSettingsProvider; _gpoSettings = gpoSettings; _rssService = rssService; _feedItems = new List <FeedItem>(); ShowWelcome = welcomeSettingsHelper.CheckIfRequiredAndSetCurrentVersion(); // Because the CheckIfRequiredAndSetCurrentVersion() sets the version in the registry, RaisePropertyChanged(nameof(ShowWelcome)); // ShowWelcome has to be set here in the ctor and not directly in the property UrlOpenCommand = commandLocator.GetCommand <UrlOpenCommand>(); ShowRssFeedCommand = new DelegateCommand(ShowRssFeed); ShowWelcomeWindow(); }