Beispiel #1
0
        public void Tracks_CanAdd_ReturnsObject(string expected)
        {
            uut.Add(expected);
            var actual        = uut.FlightTracks.First(e => e.Tag == expected.Split(';')[0]);
            var expectedTrack = new Track(expected);

            Assert.That(actual.Tag, Is.EqualTo(expectedTrack.Tag));
            Assert.That(actual.Vector.X, Is.EqualTo(expectedTrack.Vector.X));
            Assert.That(actual.Vector.Y, Is.EqualTo(expectedTrack.Vector.Y));
            Assert.That(actual.Vector.Z, Is.EqualTo(expectedTrack.Vector.Z));
            Assert.That(actual.Timestamp, Is.EqualTo(expectedTrack.Timestamp));
        }
Beispiel #2
0
 public void Add(TrackModelView playlist)
 {
     _track.Add(new Track {
         PlaylistId = playlist.PlaylistId, Title = playlist.Title, Artist = playlist.Artist, UrlTrack = playlist.UrlTrack
     });
     _unitOfWork.Commit();
 }
Beispiel #3
0
        public ActionResult Create([FromForm] Track track)
        {
            try
            {
                _repository.Add(track);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(new BadRequestResult());
            }
        }
Beispiel #4
0
        public bool Add(TrackEntity newTrack)
        {
            newTrack.ID = 0;
            var trackDTO  = _mapper.Map <Track>(newTrack);
            var opSuccess = _trackRepository.Add(trackDTO).Result;

            if (!opSuccess)
            {
                _logger.LogInformation("Failed to add new track.");
                return(opSuccess);
            }

            _logger.LogInformation("Added new track.");
            return(opSuccess);
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("Start!");

            var genre = new Genre("Dubstep");

            _genreRepository.Add(genre);
            Console.WriteLine("Genre created");

            var country = new Country("Germany");

            _countryRepository.Add(country);
            Console.WriteLine("Country created");

            var userData = new CommonUserData("Egop", "Bird", "Tit", DateTime.Today);

            _commonUserDataRepository.Add(userData);
            Console.WriteLine("CommonUserData created");

            var userLibrary = new UserLibrary(new List <Album>(), new List <Playlist>());

            _userLibraryRepository.Add(userLibrary);
            Console.WriteLine("UserLibrary created");

            var art = new Art("image.jpg");

            _artRepository.Add(art);
            Console.WriteLine("Art created");

            var playlist = new Playlist("test playlist", "test description", art, userLibrary,
                                        new List <TrackToPlaylist>());

            _playlistRepository.Add(playlist);
            Console.WriteLine("Playlist created");

            userLibrary.Playlists.Add(playlist);
            _userLibraryRepository.Update(userLibrary);

            Console.WriteLine("Playlist added to UserLibrary");

            var distributorData = new DistributorData("test distributor", country, new List <Album>(),
                                                      new List <ArtistToDistributor>());

            _distributorDataRepository.Add(distributorData);
            Console.WriteLine("DistributorData created");

            var album = new Album("test album", DateTime.Now, art, genre, distributorData, new List <Track>());

            _albumRepository.Add(album);
            Console.WriteLine("Album created");

            var track = new Track("Terror Drums", "test.mp3", 0, false, album, new List <TrackToPlaylist>());

            track.Playlists.Add(new TrackToPlaylist(track, playlist));
            _trackRepository.Add(track);
            Console.WriteLine("Track created");

            //foreach (var genre in _genreRepository.GetAll())
            //{
            //    Console.WriteLine(genre.Title);
            //}
            Console.ReadKey();
        }
Beispiel #6
0
 public void AddTrack(Track track)
 {
     trackRepository.Add(track);
     unitOfWork.SaveChanges();
 }
Beispiel #7
0
 public Track Add(Track track)
 {
     return(_trackRepository.Add(track));
 }
Beispiel #8
0
        public async Task <bool> TrackMovie(TrackedMovie model)
        {
            var result = await _trackRepository.Add(model);

            return(result);
        }
 public void Post([FromBody] Track value)
 {
     _repository.Add(value);
 }
Beispiel #10
0
        public void TrackRepository_CanAddTrack()
        {
            trackRepository.Add("Tag;10001;10001;10001;00010101010101001");

            Assert.That(trackRepository.Get("Tag").Vector.X, Is.EqualTo(10001));
        }