Ejemplo n.º 1
0
 public void GetlayLists_GivingAnInvalidUser_ReturnAnException()
 {
     var playListRepositoryStub = MockRepository.GenerateMock<IRepository<Playlist>>();
     var customerRepositoryStub = MockRepository.GenerateMock<IRepository<Customer>>();
     var tracRepositoryStub = MockRepository.GenerateMock<IRepository<Track>>();
     var loggetStub = MockRepository.GenerateMock<ILog>();
     var playListService = new PlayListService(playListRepositoryStub, customerRepositoryStub, tracRepositoryStub, loggetStub);
     customerRepositoryStub.Stub(m => m.Get()).Return(new EnumerableQuery<Customer>(new List<Customer>()));
     var playlists = playListService.GetPlayLists("NonUser");
 }
Ejemplo n.º 2
0
 public void GetlayLists_GivingAValidUser_ReturnEmptyList()
 {
     var playListRepositoryStub = MockRepository.GenerateMock<IRepository<Playlist>>();
     var customerRepositoryStub = MockRepository.GenerateMock<IRepository<Customer>>();
     var tracRepositoryStub = MockRepository.GenerateMock<IRepository<Track>>();
     var loggetStub = MockRepository.GenerateMock<ILog>();
     var playListService = new PlayListService(playListRepositoryStub, customerRepositoryStub, tracRepositoryStub,loggetStub);
     customerRepositoryStub.Stub(m => m.Get()).Return(new EnumerableQuery<Customer>(new List<Customer>(){new Customer{Email = "*****@*****.**",Id =1}}));
     playListRepositoryStub.Stub(m => m.Get()).Return(new EnumerableQuery<Playlist>(new List<Playlist>()));
     var playlists = playListService.GetPlayLists("*****@*****.**");
     playlists.Should().BeEmpty();
 }