public void ShouldResetPricePredictionIfPricePredictionOptionChangesToDisabled() { // arrange Action <ItemSearchOptions, string> listener = null; this.itemSearchOptionsMock.Setup(x => x.OnChange(It.IsAny <Action <ItemSearchOptions, string> >())) .Callback <Action <ItemSearchOptions, string> >(l => listener = l); this.viewModel = this.CreateViewModel(); this.viewModel.Currency = "chaos"; this.viewModel.Prediction = "0.25 - 0.33"; this.viewModel.ConfidenceScore = "89 %"; this.viewModel.CurrencyImage = Mock.Of <IBitmap>(); // act listener(new ItemSearchOptions { PricePredictionEnabled = false }, null); // assert Assert.That(this.viewModel.Currency, Is.Null); Assert.That(this.viewModel.Prediction, Is.Null); Assert.That(this.viewModel.ConfidenceScore, Is.Null); Assert.That(this.viewModel.CurrencyImage, Is.Null); Assert.That(this.viewModel.HasValue, Is.False); }
public void Setup() { this.itemSearchOptionsMock = new Mock <IOptionsMonitor <ItemSearchOptions> >(); this.itemSearchOptionsMock .Setup(x => x.CurrentValue) .Returns(new ItemSearchOptions()); this.mediatorMock = new Mock <IMediator>(); this.staticDataServiceMock = new Mock <IStaticDataService>(); this.imageServiceMock = new Mock <IImageService>(); this.viewModel = CreateViewModel(); }