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 <AudioDramaUserData> Get() { var dtos = new SampleDtoProvider().Get().ToList(); var userDatas = new List <AudioDramaUserData> { new AudioDramaUserData(dtos.ElementAt(0).Id, false, false), new AudioDramaUserData(dtos.ElementAt(1).Id, false, true), new AudioDramaUserData(dtos.ElementAt(2).Id, true, false), new AudioDramaUserData(dtos.ElementAt(3).Id, true, true) }; return(userDatas); }
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); }