public void GetMultiColumnActorDataTable_ActorAssigned_AssignedActorSortsLast()
        {
            var actorB = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "B"
            };
            var actorC = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "C"
            };
            var actorA = new Glyssen.VoiceActor.VoiceActor {
                Id = 3, Name = "A"
            };

            m_testProject.VoiceActorList.AllActors = new List <Glyssen.VoiceActor.VoiceActor> {
                actorB, actorC, actorA
            };
            var generator = new CharacterGroupGenerator(m_testProject);

            generator.GenerateCharacterGroups();
            generator.ApplyGeneratedGroupsToProject(false);
            var group = m_model.CharacterGroups[0];

            m_model.AssignActorToGroup(actorA.Id, group);

            var dataTable = m_model.GetMultiColumnActorDataTable(m_model.CharacterGroups[0]);
            var actorList = GetActorListFromDataTable(dataTable);

            Assert.AreEqual(actorB, actorList[0]);
            Assert.AreEqual(actorC, actorList[1]);
            Assert.AreEqual(null, actorList[2]);             // The "Unassigned" option
            Assert.AreEqual(actorA, actorList[3]);
        }
        public void NoteActorChanges_MultipleChanges_NewUndoActionAddedWithGeneralDescription_GroupsAffected()
        {
            var replacedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "B", Age = ActorAge.YoungAdult
            };

            m_testProject.VoiceActorList.AllActors.Add(replacedActor);
            var characterGroup = new CharacterGroup(m_testProject);

            m_testProject.CharacterGroupList.CharacterGroups.Add(characterGroup);
            characterGroup.AssignVoiceActor(1);
            var affectedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "B", Age = ActorAge.Adult
            };
            var deletedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "C"
            };

            m_testProject.VoiceActorList.AllActors = new List <Glyssen.VoiceActor.VoiceActor> {
                affectedActor
            };
            Assert.AreEqual(0, m_model.UndoActions.Count);
            List <CharacterGroup> affectedGroups = null;

            m_model.Saved += (sender, args) => { affectedGroups = args.ToList(); };
            m_model.NoteActorChanges(new IVoiceActorUndoAction[]
            {
                new VoiceActorEditUndoAction(m_testProject, replacedActor),
                new VoiceActorDeletedUndoAction(m_testProject, deletedActor)
            });
            Assert.AreEqual("Edit voice actors", m_model.UndoActions.Single());
            Assert.AreEqual(characterGroup, affectedGroups.Single());
        }
        public void UnAssignActorFromGroups_ByGroup()
        {
            var actor1 = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "Marco Polo"
            };

            m_testProject.VoiceActorList.AllActors.Add(actor1);
            var actor2 = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "Wilbur Wright"
            };

            m_testProject.VoiceActorList.AllActors.Add(actor2);
            var group1 = m_model.CharacterGroups[0];

            group1.SetGroupIdLabel();
            m_model.AssignActorToGroup(actor2.Id, group1);
            Assert.True(group1.IsVoiceActorAssigned);
            var group2 = AddNewGroup("Nicodemus");

            m_model.AssignActorToGroup(actor1.Id, group2);
            Assert.True(group2.IsVoiceActorAssigned);
            Assert.AreEqual(2, m_model.UndoActions.Count);

            m_model.UnAssignActorFromGroups(new List <CharacterGroup> {
                group1, group2
            });
            Assert.False(group1.IsVoiceActorAssigned);
            Assert.False(group2.IsVoiceActorAssigned);
            Assert.AreEqual(3, m_model.UndoActions.Count);
        }
        public void UnAssignActorFromGroups_GroupsContainsCameoGroup_CameoGroupNotUnassigned()
        {
            var actor1 = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "Marco Polo", IsCameo = true
            };

            m_testProject.VoiceActorList.AllActors.Add(actor1);
            var actor2 = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "Wilbur Wright"
            };

            m_testProject.VoiceActorList.AllActors.Add(actor2);
            var group1 = m_model.CharacterGroups[0];

            m_model.AssignActorToGroup(actor2.Id, group1);
            Assert.True(group1.IsVoiceActorAssigned);
            var cameoGroup = AddNewGroup();             // No characters => cameo

            m_model.AssignActorToGroup(actor1.Id, cameoGroup);
            Assert.True(cameoGroup.IsVoiceActorAssigned);
            Assert.AreEqual(2, m_model.UndoActions.Count);

            m_model.UnAssignActorFromGroups(new List <CharacterGroup> {
                group1, cameoGroup
            });
            Assert.False(group1.IsVoiceActorAssigned);
            Assert.True(cameoGroup.IsVoiceActorAssigned);
            Assert.AreEqual(3, m_model.UndoActions.Count);
        }
Exemplo n.º 5
0
        public void VoiceActorDeletedUndoAction_Redo_ActorAssignedToGroupButAssignedToDifferentGroupFollowingUndo_ReturnsFalse()
        {
            var assignedGroup  = AddCharacterGroup("Barnabas", "Caleb", "Hosea");
            var differentGroup = AddCharacterGroup("Thomas", "Jonah");
            var removedActor   = new Glyssen.VoiceActor.VoiceActor {
                Id = 4, Name = "Dominic", Age = ActorAge.YoungAdult
            };

            var action = new VoiceActorDeletedUndoAction(m_testProject, removedActor, assignedGroup);

            action.Undo();
            Assert.AreEqual(1, m_testProject.CharacterGroupList.CountVoiceActorsAssigned());
            Assert.AreEqual(4, assignedGroup.VoiceActorId);
            assignedGroup.RemoveVoiceActor();
            differentGroup.AssignVoiceActor(m_testProject.VoiceActorList.GetVoiceActorById(4).Id);

            Assert.IsFalse(action.Redo());

            var restoredActor = m_testProject.VoiceActorList.GetVoiceActorById(4);

            // Equals is just defined as having the same ID, so we need to check name and details separately.
            Assert.AreEqual(restoredActor.Name, removedActor.Name);
            Assert.IsTrue(restoredActor.IsInterchangeableWith(removedActor));
            Assert.AreEqual(4, differentGroup.VoiceActorId);
        }
        public void Undo_AssignActorToGroup_ExistingGroupAssignedToActor_ActorUnassignedFromAssignedGroupAndReassignedToPreviousGroup()
        {
            var actor1 = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "Eduardo Lopez"
            };

            m_testProject.VoiceActorList.AllActors.Add(actor1);
            var existingGroup = m_model.CharacterGroups[0];

            existingGroup.VoiceActorId = 1;
            var newGroup = AddNewGroup();

//			newGroup.Name = "New group";
            m_model.AssignActorToGroup(1, newGroup);
            List <CharacterGroup> affectedGroups = null;

            m_model.Saved += (sender, args) => { affectedGroups = args.ToList(); };
            Assert.IsTrue(m_model.Undo());
            Assert.AreEqual(0, m_model.UndoActions.Count);
            Assert.AreEqual(1, m_model.RedoActions.Count);
            Assert.AreEqual("Assign voice actor Eduardo Lopez", m_model.RedoActions[0]);
            Assert.False(newGroup.IsVoiceActorAssigned);
            Assert.AreEqual(1, existingGroup.VoiceActorId);
            Assert.IsTrue(affectedGroups.SequenceEqual(new [] { existingGroup, newGroup }));
        }
Exemplo n.º 7
0
        public void MigrateDeprecatedGenderAndAgeStrings()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Id = 0, Name = "A", GenderDeprecatedString = "M - Male", AgeDeprecatedString = "O - Old"
            };

            Assert.AreEqual(ActorAge.Elder, actor.Age);
            Assert.AreEqual(ActorGender.Male, actor.Gender);

            actor = new Glyssen.VoiceActor.VoiceActor {
                Id = 0, Name = "B", GenderDeprecatedString = "F - Female", AgeDeprecatedString = "E - Elder"
            };
            Assert.AreEqual(ActorAge.Elder, actor.Age);
            Assert.AreEqual(ActorGender.Female, actor.Gender);

            actor = new Glyssen.VoiceActor.VoiceActor {
                Id = 0, Name = "C", AgeDeprecatedString = "C - Child"
            };
            Assert.AreEqual(ActorAge.Child, actor.Age);

            actor = new Glyssen.VoiceActor.VoiceActor {
                Id = 0, Name = "D", AgeDeprecatedString = "M - Middle Adult"
            };
            Assert.AreEqual(ActorAge.Adult, actor.Age);

            actor = new Glyssen.VoiceActor.VoiceActor {
                Id = 0, Name = "E", AgeDeprecatedString = "Y - Young"
            };
            Assert.AreEqual(ActorAge.YoungAdult, actor.Age);

            actor = new Glyssen.VoiceActor.VoiceActor {
                Id = 0, Name = "E", AgeDeprecatedString = "Y - Young Adult"
            };
            Assert.AreEqual(ActorAge.YoungAdult, actor.Age);
        }
Exemplo n.º 8
0
        public void Matches_StrictAgeMatching_CharacterHasDifferentAge_ReturnsFalse()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = ActorAge.YoungAdult
            };

            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.Elder
            }, true));

            actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = ActorAge.Elder
            };
            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.YoungAdult
            }, true));

            actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = ActorAge.Child
            };
            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.Adult
            }, true));

            actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = ActorAge.Adult
            };
            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.Child
            }, true));
        }
Exemplo n.º 9
0
        public void Matches_GenderDifferent_ReturnsFalse()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Male
            };

            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female
            }));

            actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female
            };
            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Male
            }));

            actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female
            };
            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.PreferMale
            }));

            actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Male
            };
            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.PreferFemale
            }));
        }
Exemplo n.º 10
0
        private List <Tuple <int, string, List <object> > > GetExportData()
        {
            if (m_data == null)
            {
                int blockNumber = 1;
                var data        = new List <Tuple <int, string, List <object> > >();

                foreach (var book in Project.IncludedBooks)
                {
                    string singleVoiceNarratorOverride = null;
                    if (book.SingleVoice)
                    {
                        singleVoiceNarratorOverride = CharacterVerseData.GetStandardCharacterId(book.BookId, CharacterVerseData.StandardCharacter.Narrator);
                    }
                    foreach (var block in book.GetScriptBlocks(true))
                    {
                        if (IncludeVoiceActors)
                        {
                            VoiceActor.VoiceActor voiceActor = Project.GetVoiceActorForCharacter(singleVoiceNarratorOverride ?? block.CharacterIdInScript);
                            data.Add(GetExportDataForBlock(block, blockNumber++, book.BookId, voiceActor, singleVoiceNarratorOverride, IncludeVoiceActors));
                        }
                        else
                        {
                            data.Add(GetExportDataForBlock(block, blockNumber++, book.BookId, null, singleVoiceNarratorOverride, IncludeVoiceActors));
                        }
                    }
                }
                m_data = data;
            }
            return(m_data);
        }
        public void GetMultiColumnActorDataTable_NoActorsAssigned_GetsAllActorsInAlphbeticalOrder()
        {
            var actorB = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "B"
            };
            var actorC = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "C"
            };
            var actorA = new Glyssen.VoiceActor.VoiceActor {
                Id = 3, Name = "A"
            };

            m_testProject.VoiceActorList.Actors = new List <Glyssen.VoiceActor.VoiceActor> {
                actorB, actorC, actorA
            };
            new CharacterGroupGenerator(m_testProject, m_testProject.GetKeyStrokesByCharacterId(), false).UpdateProjectCharacterGroups();

            var dataTable = m_model.GetMultiColumnActorDataTable(m_model.CharacterGroups[0]);
            var actorList = GetActorListFromDataTable(dataTable);

            Assert.AreEqual(actorA, actorList[0]);
            Assert.AreEqual(actorB, actorList[1]);
            Assert.AreEqual(actorC, actorList[2]);
            Assert.AreEqual(null, actorList[3]);             // The "Unassigned" option
        }
Exemplo n.º 12
0
        public void IsValid_HasName_ReturnsTrue()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Name = "A"
            };

            Assert.IsTrue(actor.IsValid());
        }
Exemplo n.º 13
0
        public void IsValid_HasNoName_ReturnsFalse()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female
            };

            Assert.IsFalse(actor.IsValid());
        }
Exemplo n.º 14
0
        public void Matches_CharacterMatchesExactlyOnGenderAndAge_ReturnsTrue()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = ActorAge.Elder
            };

            Assert.IsTrue(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.Elder
            }));
        }
Exemplo n.º 15
0
        public void Matches_StrictAgeMatchingFalse_CharacterIsNotChild_ActorIsAChild_ReturnsFalse()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = ActorAge.Child
            };

            Assert.IsFalse(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.YoungAdult
            }, false));
        }
Exemplo n.º 16
0
        public void Matches_CharacterGenderPrefFemale_ActorGenderFemale_ReturnsTrue()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female
            };

            Assert.IsTrue(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.PreferFemale
            }));
        }
Exemplo n.º 17
0
        public void Matches_StrictAgeMatchingFalse_CharacterIsChild_ActorIsNonElderlyFemale_ReturnsTrue(ActorAge age)
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Female, Age = age
            };

            Assert.IsTrue(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Female, Age = CharacterAge.Child
            }, false));
        }
Exemplo n.º 18
0
        public void Matches_MaleActorCharacterGenderEither_ReturnsTrue()
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = ActorGender.Male
            };

            Assert.IsTrue(actor.Matches(new CharacterDetail {
                Gender = CharacterGender.Either
            }));
        }
        public void Contructor_MultipleEditingActions_AffectedGroupsConsistsOfGroupsAssignedToAffectedActors()
        {
            var maleGroup = AddCharacterGroup("Moses", "John");

            m_testProject.CharacterGroupList.CharacterGroups.Add(maleGroup);
            var femaleGroup = AddCharacterGroup("Mary", "Ruth");

            m_testProject.CharacterGroupList.CharacterGroups.Add(femaleGroup);
            var childGroup = AddCharacterGroup("children");

            m_testProject.CharacterGroupList.CharacterGroups.Add(childGroup);
            var anotherGroup = AddCharacterGroup("Pharisees", "ear");

            m_testProject.CharacterGroupList.CharacterGroups.Add(anotherGroup);

            var affectedActorA = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "A", Age = ActorAge.YoungAdult
            };
            var replacedActorA = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "A"
            };
            var affectedActorB = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "B", Gender = ActorGender.Female
            };
            var replacedActorB = new Glyssen.VoiceActor.VoiceActor {
                Id = 2, Name = "B"
            };
            var addedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 3, Name = "C", Age = ActorAge.YoungAdult
            };
            var removedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 4, Name = "D", Age = ActorAge.YoungAdult
            };
            var unchangedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 5, Name = "E", Age = ActorAge.Child
            };

            m_testProject.VoiceActorList.AllActors = new List <Glyssen.VoiceActor.VoiceActor> {
                affectedActorA, affectedActorB, addedActor, unchangedActor
            };

            maleGroup.AssignVoiceActor(1);
            femaleGroup.AssignVoiceActor(2);
            childGroup.AssignVoiceActor(5);

            var action = new VoiceActorEditingUndoAction(m_testProject, new IVoiceActorUndoAction[]
            {
                new VoiceActorEditUndoAction(m_testProject, replacedActorA),
                new VoiceActorEditUndoAction(m_testProject, replacedActorB),
                new VoiceActorAddedUndoAction(m_testProject, addedActor.Id),
                new VoiceActorDeletedUndoAction(m_testProject, removedActor)
            });

            Assert.IsTrue(action.GroupsAffectedByLastOperation.SetEquals(new [] { maleGroup, femaleGroup }));
        }
Exemplo n.º 20
0
        public void GetAgeMatchQuality_Mismatch(ActorAge actorAge, CharacterAge characterAge)
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Age = actorAge
            };
            var matchQuality = actor.GetAgeMatchQuality(new CharacterDetail {
                Age = characterAge
            });

            Assert.AreEqual(MatchLevel.Mismatch, matchQuality);
        }
Exemplo n.º 21
0
        public void GetAgeMatchQuality_CloseAdult(ActorAge actorAge, CharacterAge characterAge)
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Age = actorAge
            };
            var matchQuality = actor.GetAgeMatchQuality(new CharacterDetail {
                Age = characterAge
            });

            Assert.AreEqual(MatchLevel.Acceptable, matchQuality);
        }
Exemplo n.º 22
0
        public void GetGenderMatchQuality_Acceptable(ActorGender actorGender, CharacterGender characterGender)
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = actorGender
            };
            var matchQuality = actor.GetGenderMatchQuality(new CharacterDetail {
                Gender = characterGender
            });

            Assert.AreEqual(GenderMatchQuality.Acceptable, matchQuality);
        }
Exemplo n.º 23
0
        public void GetAgeMatchQuality_AdultVsChild(ActorAge actorAge, CharacterAge characterAge)
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Age = actorAge
            };
            var matchQuality = actor.GetAgeMatchQuality(new CharacterDetail {
                Age = characterAge
            });

            Assert.AreEqual(AgeMatchQuality.AdultVsChild, matchQuality);
        }
Exemplo n.º 24
0
        public void GetGenderMatchQuality_Mismatch(ActorGender actorGender, CharacterGender characterGender)
        {
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = actorGender
            };
            var matchQuality = actor.GetGenderMatchQuality(new CharacterDetail {
                Gender = characterGender
            });

            Assert.AreEqual(MatchLevel.Mismatch, matchQuality);
        }
Exemplo n.º 25
0
        public void VoiceActorAddedUndoAction_Description_ActorSubsequentlyDeleted_AddedActorReferencedByName()
        {
            var addedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 3, Name = "Chuck", Age = ActorAge.YoungAdult
            };

            m_testProject.VoiceActorList.Actors.Add(addedActor);
            var action = new VoiceActorAddedUndoAction(m_testProject, 3);

            m_testProject.VoiceActorList.Actors.Remove(addedActor);
            Assert.AreEqual("Add voice actor Chuck", action.Description);
        }
        public void Contructor_SingleEditingActionForUnassignedActor_AffectedGroupsIsEmpty()
        {
            m_testProject.VoiceActorList.AllActors.Add(new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "B", Age = ActorAge.Adult
            });
            var replacedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 1, Name = "B", Age = ActorAge.YoungAdult
            };
            var action = new VoiceActorEditingUndoAction(m_testProject, new[] { new VoiceActorEditUndoAction(m_testProject, replacedActor) });

            Assert.AreEqual(0, action.GroupsAffectedByLastOperation.Count());
        }
        public void Description_SingleActorDeleted_DeletedActorReferencedByName()
        {
            var removedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 4, Name = "Dominic", Age = ActorAge.YoungAdult
            };

            var action = new VoiceActorEditingUndoAction(m_testProject, new[]
            {
                new VoiceActorDeletedUndoAction(m_testProject, removedActor)
            });

            Assert.AreEqual("Delete voice actor Dominic", action.Description);
        }
Exemplo n.º 28
0
        public void GetGenderMatchQuality_Acceptable(ActorGender actorGender, CharacterGender characterGender)
        {
            // This might seem odd at first glance, but the only "prefer female" characters in the data
            // could easily be performed by a male actor.
            var actor = new Glyssen.VoiceActor.VoiceActor {
                Gender = actorGender
            };
            var matchQuality = actor.GetGenderMatchQuality(new CharacterDetail {
                Gender = characterGender
            });

            Assert.AreEqual(MatchLevel.Acceptable, matchQuality);
        }
Exemplo n.º 29
0
        internal static List <object> GetExportDataForBlock(Block block, int blockNumber, string bookId,
                                                            VoiceActor.VoiceActor voiceActor, string singleVoiceNarratorOverride, bool useCharacterIdInScript, bool includeSecondaryDirectorsGuide)
        {
            // NOTE: if the order here changes, there may be changes needed in GenerateExcelFile
            List <object> list = new List <object>();

            list.Add(blockNumber);
            if (voiceActor != null)
            {
                list.Add(voiceActor.Name);
            }
            list.Add(block.StyleTag);
            list.Add(bookId);
            list.Add(block.ChapterNumber);
            list.Add(block.InitialVerseNumberOrBridge);
            string characterId;

            if (singleVoiceNarratorOverride != null)
            {
                characterId = singleVoiceNarratorOverride;
            }
            else
            {
                characterId = useCharacterIdInScript ? block.CharacterIdInScript : block.CharacterId;
            }
            list.Add(CharacterVerseData.IsCharacterStandard(characterId) ? CharacterVerseData.GetStandardCharacterIdAsEnglish(characterId) : characterId);

            // add a column for the localized character id
            if (LocalizationManager.UILanguageId != "en")
            {
                list.Add(CharacterVerseData.GetCharacterNameForUi(characterId));
            }

            list.Add(block.Delivery);
            list.Add(block.GetText(true));
            list.Add(block.PrimaryReferenceText);
            if (includeSecondaryDirectorsGuide)
            {
                var primaryRefBlock = (block.MatchesReferenceText) ? block.ReferenceBlocks.Single() : null;
                if (primaryRefBlock != null && primaryRefBlock.MatchesReferenceText)
                {
                    list.Add(primaryRefBlock.PrimaryReferenceText);
                }
                else
                {
                    list.Add(null);
                }
            }
            list.Add(block.GetText(false).Length);
            return(list);
        }
Exemplo n.º 30
0
        public void VoiceActorDeletedUndoAction_Redo_Normal_ActorReDeleted()
        {
            var removedActor = new Glyssen.VoiceActor.VoiceActor {
                Id = 4, Name = "Dominic", Age = ActorAge.YoungAdult
            };

            var action = new VoiceActorDeletedUndoAction(m_testProject, removedActor);

            action.Undo();
            Assert.IsTrue(action.Redo());

            Assert.IsNull(m_testProject.VoiceActorList.GetVoiceActorById(4));
            Assert.IsNull(m_testProject.VoiceActorList.Actors.SingleOrDefault(a => a.Name == "Dominic"));
        }