public void Roundtrip_Actors() { using (TempFile tempFile = new TempFile()) { VoiceActorList list = new VoiceActorList(); list.AllActors = new List <Glyssen.VoiceActor.VoiceActor> { new Glyssen.VoiceActor.VoiceActor { Id = 0, Name = "A", Gender = ActorGender.Female, Age = ActorAge.Elder }, new Glyssen.VoiceActor.VoiceActor { Id = 1, Name = "B" } }; // Generates file correctly list.SaveToFile(tempFile.Path); AssertThatXmlIn.File(tempFile.Path) .HasSpecifiedNumberOfMatchesForXpath("/VoiceActors/VoiceActor", 2); AssertThatXmlIn.File(tempFile.Path) .HasSpecifiedNumberOfMatchesForXpath("/VoiceActors/VoiceActor[@Id='0' and @Gender='Female' and @Age='Elder' and text()='A']", 1); AssertThatXmlIn.File(tempFile.Path) .HasSpecifiedNumberOfMatchesForXpath("/VoiceActors/VoiceActor[@Id='1' and @Gender='Male' and @Age='Adult' and text()='B']", 1); // Reads from file correctly VoiceActorList listFromFile = VoiceActorList.LoadVoiceActorListFromFile(tempFile.Path); Assert.AreEqual(list.ActiveActors, listFromFile.ActiveActors); } }
public CastSizeRowValues(VoiceActorList actualActorList) { Male = actualActorList.ActiveMaleAdultActorCount; Female = actualActorList.ActiveFemaleAdultActorCount; Child = actualActorList.ActiveChildActorCount; }