Пример #1
0
        public static AlbumsCollection GetAlbumsByName(string name)
        {
            var result = new AlbumsCollection();

            albums.Where(a => a.Name == name).ToList().ForEach(result.Add);
            return(result);
        }
    public ActionResult Index()
    {
        AlbumsCollection albumsCollection = new AlbumsCollection();

        albumsCollection.Albums = context.Albums;

        return(View(albumsCollection));
    }
        public Albums()
        {
            this.InitializeComponent();
            AlbumsCollection collection = new AlbumsCollection();

            collection.AddAlbumsToCollection();
            var somt = collection.GetAlbums();

            data.ItemsSource = somt;
        }
Пример #4
0
        public Artist(string name, DateTime year, SongsCollection songs, AlbumsCollection albums)
        {
            this.Name   = name;
            this.Year   = year;
            this.Songs  = songs;
            this.Albums = albums;

            this.CreateTimeStamp = DateTime.Now;
            this.UpdateTimeStamp = DateTime.Now;
        }
Пример #5
0
        public void GetAllCountriesFromAlbums()
        {
            AlbumsCollection collection = new AlbumsCollection();

            collection.CreateAlbums();

            foreach (var country in collection.AllCountries)
            {
                _testOutputHelper.WriteLine(country);
            }
        }
Пример #6
0
        public void GetAllYearsFromAlbums()
        {
            AlbumsCollection collection = new AlbumsCollection();

            collection.CreateAlbums();

            foreach (var year in collection.AllYears)
            {
                _testOutputHelper.WriteLine(year.ToString());
            }
        }
Пример #7
0
        public void GetAllStylesFromAlbums()
        {
            AlbumsCollection collection = new AlbumsCollection();

            collection.CreateAlbums();

            foreach (var style in collection.AllStyles)
            {
                _testOutputHelper.WriteLine(style);
            }
        }
Пример #8
0
        public void GetAllAlbumsWithArtists()
        {
            AlbumsCollection collection = new AlbumsCollection();

            collection.CreateAlbums();

            var albumName = collection.albums;

            foreach (var el in albumName)
            {
                _testOutputHelper.WriteLine($"Album: {el.Name}, Artist: {el.Artist.Name}");
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            AlbumsCollection coll = new AlbumsCollection();

            coll.AddAlbumsToCollection();

            string albumName = e.Parameter.ToString();

            var alb = coll.GetAlbumByName(albumName);

            someData.ItemsSource = alb;

            base.OnNavigatedTo(e);
        }
Пример #10
0
        public void GetSpecifiedAlbumNamesByStyle()
        {
            AlbumsCollection collection = new AlbumsCollection();
            string           style      = "Proggresive Rock";

            collection.CreateAlbums();

            var specifiedAlbum = collection.albums.Where(x => x.Style == style).Select(x => x.Name);

            foreach (var el in specifiedAlbum)
            {
                _testOutputHelper.WriteLine(el);
            }
        }
        public void FiltersOcurrenceCounterTest()
        {
            var albumsCollection = new AlbumsCollection();

            albumsCollection.CreateAlbums();

            foreach (var el in albumsCollection.allFilters.Genres)
            {
                if (!albumsCollection.allFilters.genresOcurrences.ContainsKey(el))
                {
                    albumsCollection.allFilters.genresOcurrences.Add(el, 1);
                }
                else
                {
                    albumsCollection.allFilters.genresOcurrences[el] += 1;
                }
            }

            foreach (var(key, value) in albumsCollection.allFilters.genresOcurrences)
            {
                _testOutputHelper.WriteLine($"{key} {value}");
            }
        }