Beispiel #1
0
        public void GetAlbumViewModelTest()
        {
            var artistDto = CreateArtist();

            var albumDto = new Album
            {
                Id       = 1,
                Name     = "Some album",
                Artist   = artistDto,
                ArtistId = artistDto.Id
            };
            var albumViewModel = ModelsMapper.GetAlbumViewModel(albumDto);

            Assert.IsNotNull(albumViewModel);

            Assert.IsTrue(albumViewModel.Id == albumDto.Id);
            Assert.IsTrue(albumViewModel.Name.Equals(albumDto.Name, StringComparison.OrdinalIgnoreCase));

            Assert.IsNotNull(albumViewModel.Artist);
            Assert.IsTrue(albumViewModel.Artist.Id == albumDto.ArtistId);
        }