コード例 #1
0
        public void AlbumsSearchedTest_SearchingAlbumThatDoesntExists()
        {
            AlbumsController controller = new AlbumsController();
            var result = controller.AlbumsSearched("XXXXXXXXXXXXXXX") as ViewResult;
            var restultCastedToList = (List <Album>)result.Model;

            Assert.IsEmpty(restultCastedToList);
        }
コード例 #2
0
        public void IsAlbumsSerchedInstanceOfList()
        {
            AlbumsController controller = new AlbumsController();
            ViewResult       result     = controller.AlbumsSearched("Rap") as ViewResult;
            var xd  = (List <Album>)result.Model;
            var xd1 = xd[0];

            Assert.IsInstanceOf(typeof(List <Album>), result.Model);
        }
コード例 #3
0
        public void AlbumsSearchedTest_SearchingAlbumThatExists_CaseInsensitive()
        {
            AlbumsController controller = new AlbumsController();
            var result = controller.AlbumsSearched("rap") as ViewResult;
            var restultCastedToList = (List <Album>)result.Model;

            Assert.AreEqual(fakeDB()[0].Genere, restultCastedToList[0].Genere);
            Assert.AreEqual(fakeDB()[0].Artist, restultCastedToList[0].Artist);
            Assert.AreEqual(fakeDB()[0].Title, restultCastedToList[0].Title);
            Assert.AreEqual(fakeDB()[1].Genere, restultCastedToList[1].Genere);
            Assert.AreEqual(fakeDB()[1].Artist, restultCastedToList[1].Artist);
            Assert.AreEqual(fakeDB()[1].Title, restultCastedToList[1].Title);
            Assert.AreEqual(fakeDB().Count, restultCastedToList.Count);
        }