コード例 #1
0
        public void Settings_Service_Called_On_SoberTimeDisplayPreferenceChangedMessage()
        {
            _settingsService.Reset();
            _settingsService.Setup(s => s.Get(PreferenceConstants.SoberTimeDisplay, It.IsAny <int>()))
            .Returns(0);

            ViewModelUnderTest.Receive(new Messages.SoberTimeDisplayPreferenceChangedMessage(SoberTimeDisplayPreference.DaysMonthsYears));
            _settingsService.Verify(x => x.Get(PreferenceConstants.SoberTimeDisplay, It.IsAny <int>()), Times.Once);
        }
コード例 #2
0
        public void Settings_Service_Called_On_SoberDateChangedMessage()
        {
            _settingsService.Reset();
            _settingsService.Setup(s => s.Get(PreferenceConstants.SoberDate, It.IsAny <DateTime>()))
            .Returns(_soberDate);

            ViewModelUnderTest.Receive(new Messages.SoberDateChangedMessage(DateTime.Today));
            _settingsService.Verify(x => x.Get(PreferenceConstants.SoberDate, It.IsAny <DateTime>()), Times.Once);
        }