public VoiceActor.VoiceActor AddNewActorToGroup(string actorName, CharacterGroup group) { Debug.Assert(!group.AssignedToCameoActor); var actorViewModel = new VoiceActorInformationViewModel(m_project); if (actorViewModel.IsDuplicateActorName(null, actorName) || actorName == "Remove Voice Actor Assignment") { throw new InvalidOperationException("Attempting to add existing actor!"); } var newActor = actorViewModel.AddNewActor(); newActor.Name = actorName; switch (group.GroupIdLabel) { case CharacterGroup.Label.Female: newActor.Gender = ActorGender.Female; break; case CharacterGroup.Label.Child: newActor.Age = ActorAge.Child; break; } AssignActorToGroup(newActor.Id, group); actorViewModel.SaveVoiceActorInformation(); return(newActor); }
public void ValidateActor_NameIsBlank_ReturnNoName() { m_model.AddNewActor(); Assert.AreEqual(VoiceActorInformationViewModel.ActorValidationState.NoName, m_model.ValidateActor(m_model.Actors.Count - 1)); }