public RootPageModel(AppState appState) { _appState = appState; _appState.PropertyChanged += OnAppStatePropertyChanged; AddItemCommand = new Command(() => { var item = appState.AddNewItem(); appState.SelectItem(item); }); DeleteItemCommand = new Command( () => appState.DeleteItem(appState.SelectedItem), () => (appState.SelectedItem != null) ); }
public void AddNewItem_DoesAddItem() { var sut = new AppState(); sut.AddNewItem(); Assert.Single(sut.Items); }