Пример #1
0
        public void MapTest1()
        {
            Song   expected = GetSong();
            string source   = GetString();
            Song   actual   = new Song
            {
                Title = "Näher, mein Gott, zu Dir"
            };
            var m = new TextualSongRepresentationMapper();

            m.Map(source, actual);

            Assert.AreEqual(expected.Parts.Count, actual.Parts.Count);
            for (var i = 0; i < expected.Parts.Count; i++)
            {
                Assert.AreEqual(expected.Parts[i].Caption, actual.Parts[i].Caption);
                for (var j = 0; j < expected.Parts[i].Slides.Count; j++)
                {
                    Assert.AreEqual(expected.Parts[i].Slides[j].Lines.Count, actual.Parts[i].Slides[j].Lines.Count);
                    for (var k = 0; k < expected.Parts[i].Slides[j].Lines.Count; k++)
                    {
                        Assert.AreEqual(expected.Parts[i].Slides[j].Lines[k], actual.Parts[i].Slides[j].Lines[k]);
                    }
                }
            }
            Assert.AreEqual(expected.Parts, actual.Parts);
            Assert.AreEqual(expected.PartSequence, actual.PartSequence);

            Assert.AreEqual(expected.GetHashCode(), actual.GetHashCode());
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void MapTest()
        {
            string expected = GetString();
            var    m        = new TextualSongRepresentationMapper();
            string actual   = m.Map(GetSong());

            Assert.AreEqual(expected, actual);
        }