示例#1
0
        public void VerifyOutofBoundsAlbum()
        {
            var id = 101;

            AlbumLoaderDAL.LoadAlbums();

            var album = AlbumLoaderDAL.GetAlbumById(id);

            Assert.IsNull(album, "This should be null, we only have 100 albums and an error gets displayed to user!");
        }
示例#2
0
        public void VerifyGetSingleAlbum()
        {
            var id = 10;

            AlbumLoaderDAL.LoadAlbums();

            var album = AlbumLoaderDAL.GetAlbumById(id);

            Assert.AreEqual(id, album.AlbumId, "Album Ids do not match!");
        }
示例#3
0
        public void VerifyAlbumPhoto()
        {
            var id = 3;

            var expectedId    = 101;
            var expectedTitle = "incidunt alias vel enim";

            AlbumLoaderDAL.LoadAlbums();

            var album = AlbumLoaderDAL.GetAlbumById(id);
            var photo = album.Photos.Where(p => p.Id == expectedId).FirstOrDefault();

            var actualId    = photo.Id;
            var actualTitle = photo.Title;

            Assert.AreEqual(expectedId, actualId, "Ids do not match!");
            Assert.AreEqual(expectedTitle, actualTitle, "Titles do not match!");
        }
示例#4
0
        static void Main(string[] args)
        {
            AlbumLoaderDAL.LoadAlbums();
            var runProgram = true;

            DisplayGreeting();
            while (runProgram)
            {
                var input = InputBLL.GetInput();

                if (InputBLL.ExitProgram(input))
                {
                    runProgram = false;
                }
                InputBLL.HandleInput(input);
            }

            void DisplayGreeting()
            {
                Console.WriteLine("Welcome to Alex's Techincal Showcase Photo Album!");
                Console.WriteLine("In order to see a list of options please type 'help'.");
                Console.WriteLine("In order to view an Album's content please enter the album Id:");
            }
        }
示例#5
0
        public void VerifyAlbumsLoad()
        {
            var albumList = AlbumLoaderDAL.LoadAlbums();

            Assert.IsNotNull(albumList, "Album list failed to load correctly");
        }