public void IsValid() { action = new BattleAction(String.Empty); Assert.That(action.IsValid(), Is.False); action.AlterInfo("name", .5, 0); Assert.That(action.IsValid(), Is.True); action.AlterInfo(String.Empty, .5, 0); Assert.That(action.IsValid(), Is.False); action.AlterInfo("name", 0, 0); Assert.That(action.IsValid(), Is.False); }
private void AddActionToPartyMember(Object sender, RoutedEventArgs e) { var action = new BattleAction(String.Empty); var addActionWindow = new EditAction(action); addActionWindow.Owner = this; addActionWindow.ShowDialog(); if (action.IsValid()) partyViewModel.AddActionToPartyMember(action); fileAccessor.SaveParty(partyViewModel.Party); }
private void Save(Object sender, RoutedEventArgs e) { var action = new BattleAction(String.Empty); var newActionWindow = new EditAction(action); newActionWindow.Owner = this; newActionWindow.ShowDialog(); if (action.IsValid()) participantViewModel.AddAction(action); Close(); }