示例#1
0
        public void Update_NameIncorrect_ShouldThrownPublisherIncorrectException()
        {
            var          publisher = Publishers.First();
            PublisherDto dto       = new PublisherDto();

            Assert.Throws <PublisherIncorrectException>(async() => await PublishersService.Update(publisher.Id, dto));
        }
示例#2
0
        public void Update_ExistingName_ShouldThrownPublisherDublicateException()
        {
            var          existingPublisher = Publishers.First();
            PublisherDto dto = new PublisherDto()
            {
                Id   = existingPublisher.Id,
                Name = existingPublisher.Name
            };

            Assert.Throws <PublisherDublicateException>(async() => await PublishersService.Update(dto.Id, dto));
        }
示例#3
0
        public async Task Update_ShouldUpdate()
        {
            var          publisher = Publishers.First();
            PublisherDto dto       = new PublisherDto()
            {
                Id   = publisher.Id,
                Name = "very updated name"
            };
            await PublishersService.Update(publisher.Id, dto);

            Assert.That(Publishers.Single(x => x.Id == dto.Id).Name, Is.EqualTo(dto.Name));
        }
示例#4
0
        public ActionResult Update(ResponsePublisherViewModel responsePublisherViewModel)
        {
            var publisherViewModel = publishersService.Update(responsePublisherViewModel);

            return(Json(new[] { publisherViewModel }));
        }