public void ShouldDeleteLocation_WhenPublisherDeleted()
        {
            var publisherService = new PublisherService();
            var publisher        = publisherService.CreateAndRetrievePublisher(new CreatePublisherDto("", "", -1, "", testLibrary.LibraryId));
            var locationId       = CreateNewLocation(testLibrary, publisher);

            publisherService.DeletePublisher(publisher).ConfigureAwait(false);
            var locationRetrieved = repository.GetLocation(locationId);

            CollectionAssert.AreEquivalent(new List <Location>()
            {
                locationRetrieved
            }, repository.GetDeletedLocations(GetFirstPage()).Result.Results);
            CollectionAssert.AreEquivalent(new List <Location>(), repository.GetLocations(GetFirstPage()).Result.Results);
        }
        public void ShouldDeleteVideo_WhenPublisherDeleted()
        {
            var publisherService = new PublisherService();
            var publisher        = publisherService.CreateAndRetrievePublisher(new CreatePublisherDto("", "", -1, "", testLibrary.LibraryId));
            var videoToCreate    = GetNewVideoDetails(publisher);
            var videoId          = repository.CreateVideo(videoToCreate);

            publisherService.DeletePublisher(publisher).ConfigureAwait(false);
            var videoRetrieved = repository.GetVideo(videoId).Result;

            CollectionAssert.AreEquivalent(new List <Video>()
            {
                videoRetrieved
            }, repository.GetDeletedVideos(GetFirstPage()).Result.Results);
            CollectionAssert.AreEquivalent(new List <Video>(), repository.GetVideos(GetFirstPage()).Result.Results);
        }
Beispiel #3
0
 public static void DeletePublisher(Publisher publisher)
 {
     PublisherService.DeletePublisher(publisher);
 }
 public void When_DeleteStorage_Completed_VerifyStorageRepository()
 {
     _sut.DeletePublisher(Guid.NewGuid().ToString());
     _publisherRepositoryMock.Verify(t => t.Delete(It.IsAny <string>()), Times.Once);
 }
Beispiel #5
0
 public IActionResult DeletePublisher(int id)
 {
     _publisherrService.DeletePublisher(id);
     return(Ok());
 }