public void TestIsSelected() { var viewModel = new AnalysisDataSourceViewModel(_dataSource.Object) { CurrentAnalysis = _analysis.Object }; viewModel.IsSelected.Should().BeFalse(); viewModel.IsSelected = true; _dataSource.Verify(x => x.EnableAnalysis(It.Is <AnalysisId>(y => y == _analysisId)), Times.Once); viewModel.IsSelected = false; _dataSource.Verify(x => x.DisableAnalysis(It.Is <AnalysisId>(y => y == _analysisId)), Times.Once); }
public void TestChangeAnalysis() { var viewModel = new AnalysisDataSourceViewModel(_dataSource.Object); _dataSource.Setup(x => x.IsAnalysisActive(It.Is <AnalysisId>(y => y == _analysisId))) .Returns(true); viewModel.IsSelected.Should().BeFalse(); viewModel.CurrentAnalysis = _analysis.Object; viewModel.IsSelected.Should().BeTrue(); viewModel.CurrentAnalysis = null; viewModel.IsSelected.Should().BeFalse(); }