Esempio n. 1
0
        public void Test()
        {
            ArtistDataAccess _access = new ArtistDataAccess(mockContext.Object);

            Artist artist = new Artist
            {
                ArtistID    = 999999,
                Name        = "Test",
                Rating      = 0.5f,
                Listens     = 3,
                Description = "descript",
                WordVec     = "1,2,3"
            };

            _access.Create(999999, artist);

            mockSet.Verify(m => m.Add(It.IsAny <Artist>()), Times.Once());
            mockContext.Verify(m => m.SaveChanges(), Times.Once());

            var artist2 = _access.Get(999999).First();

            Assert.AreEqual(artist2.ArtistID, artist.ArtistID);
            Assert.AreEqual(artist2.Name, artist.Name);
            Assert.AreEqual(artist2.Rating, artist.Rating);
            Assert.AreEqual(artist2.Listens, artist.Listens);
            Assert.AreEqual(artist2.Description, artist.Description);
            Assert.AreEqual(artist2.WordVec, artist.WordVec);

            _access.Delete(999999);

            Assert.IsTrue(_access.Exists(999999));
        }
Esempio n. 2
0
 public DeleteModel(Eevee.Data.EeveeContext context)
 {
     _access = new ArtistDataAccess(context);
 }
Esempio n. 3
0
 public EditModel(EeveeContext context)
 {
     _access = new ArtistDataAccess(context);
 }
Esempio n. 4
0
 public CreateModel(Eevee.Data.EeveeContext context, NaturalLanguage.NN.INN textprocessor)
 {
     _context       = context;
     _textprocessor = textprocessor;
     _access        = new ArtistDataAccess(context);
 }