public void TestCorrectBuilding() { var dtoProvider = new SampleDtoProvider(); var dtos = dtoProvider.Get().ToList(); var userDataProvider = new SampleUserDataProvider(); var userData = userDataProvider.Get().ToList(); var audioDramas = new List <AudioDrama>(); for (var i = 0; i < dtos.Count; i++) { var audioDrama = new AudioDrama( dtos.ElementAt(i), userData.ElementAt(i)); audioDramas.Add(audioDrama); } dtos.Reverse(); var builder = new AudioDramaBuilder(); var buildResult = builder.Build(dtos, userData).ToList(); foreach (var audioDrama in audioDramas) { var buildAudioDrama = buildResult.Single(x => x.Equals(audioDrama)); Assert.AreEqual(audioDrama.AudioDramaDto, buildAudioDrama.AudioDramaDto); Assert.AreEqual(audioDrama.AudioDramaUserData, buildAudioDrama.AudioDramaUserData); } }
public IEnumerable <AudioDrama> Get() { var dtoProvider = new SampleDtoProvider(); var userDataProvider = new SampleUserDataProvider(); var dtos = dtoProvider.Get().ToList(); var userDatas = userDataProvider.Get().ToList(); var audioDramas = new List <AudioDrama>(); for (var i = 0; i < dtos.Count; i++) { var audioDrama = new AudioDrama( dtos.ElementAt(i), userDatas.ElementAt(i)); audioDramas.Add(audioDrama); } return(audioDramas); }