Exemplo n.º 1
0
        public void GetAllBandsTest()
        {
            List <MusicAlbum> albums = new List <MusicAlbum>
            {
                new MusicAlbum("TestName", 200, 2200, "Pink Floyd"),
                new MusicAlbum("TestName", 200, 2100, "Pink Floyd"),
                new MusicAlbum("TestName", 200, 2000, "Pink Floyd"),
                new MusicAlbum("TestName", 201, 2005, "Pink Floyd"),
                new MusicAlbum("TestName", 202, 2006, "Metallica"),
                new MusicAlbum("TestName", 203, 2007, "Dire Straits")
            };

            Assert.AreEqual(3, DataLinqFilter.GetAllBands(albums).Count);
        }
Exemplo n.º 2
0
        public void GetAllBandsStringsComparisonTest()
        {
            List <MusicAlbum> albums = new List <MusicAlbum>
            {
                new MusicAlbum("TestName", 200, 2200, "Pink Floyd"),
                new MusicAlbum("TestName", 200, 2100, "Pink Floyd"),
                new MusicAlbum("TestName", 200, 2000, "Pink Floyd"),
                new MusicAlbum("TestName", 201, 2005, "Pink Floyd"),
                new MusicAlbum("TestName", 202, 2006, "Metallica"),
                new MusicAlbum("TestName", 203, 2007, "Dire Straits")
            };

            var albumBands = DataLinqFilter.GetAllBands(albums);

            Assert.AreEqual(1, (from album in albumBands where album.Contains("Pink Floyd") select album).Count());
        }