コード例 #1
0
        public void C_Update()
        {
            Project.Data.Repository repo = new Project.Data.Repository(db);
            int songid = 0;

            foreach (var i in repo.GetSongs())
            {
                songid = i.Id;
            }
            Project.Domain.Song songTest = new Project.Domain.Song()
            {
                Id          = songid,
                Title       = "Encore",
                Artist      = "Linkin Park",
                Genre       = "Rock",
                Size        = "3.45",
                Length      = "3.7",
                ReleaseDate = "1993",
                FilePath    = "audio/file"
            };


            repo.UpdateSong(songTest);

            Assert.Pass();
        }
コード例 #2
0
        public void B_Read_3()
        {
            int songId = 0;

            Project.Data.Repository repo = new Project.Data.Repository(db);
            foreach (var i in repo.GetSongs())
            {
                songId = i.Id;
            }
            Project.Domain.Song song = repo.GetSongByTitle("Encore", "Linkin Park");
            Assert.AreEqual(song.Id, songId);
        }
コード例 #3
0
        public void B_Read_2()
        {
            int songId = 0;

            Project.Data.Repository repo = new Project.Data.Repository(db);
            foreach (var i in repo.GetSongs())
            {
                songId = i.Id;
            }
            Project.Domain.Song song = repo.GetSongById(songId);

            string expectedValue = "Encore";
            string actualValue   = song.Title;

            Assert.AreEqual(expectedValue, actualValue);
            //Assert.Pass();
        }
コード例 #4
0
        public void A_Create()
        {
            Project.Data.Repository repo     = new Project.Data.Repository(db);
            Project.Domain.Song     songTest = new Project.Domain.Song()
            {
                Title       = "Encore",
                Artist      = "Linkin Park",
                Genre       = "Rock",
                Size        = "3.45",
                Length      = "3.7",
                ReleaseDate = "1993",
                FilePath    = "audio/file"
            };

            Assert.IsNotNull(songTest.Size);

            repo.CreateSong(songTest);
            Assert.Pass();
        }