public void AddArticle_ShouldCallRepositoryMethod() { var concert = new ConcertDto { Id = Guid.Parse("0597b8a3-e404-4fff-828e-72d99d489d4c"), Name = "Name4", Price = 100, LocationId = Guid.Parse("7597b8a3-e404-4fff-828e-72d99d489d4d") }; repositoryMock.Setup(x => x.Insert <Concert>(It.IsAny <Concert>())); var expectedResult = concertLogic.AddConcert(concert); repositoryMock.Verify(r => r.Insert <Concert>(It.IsAny <Concert>()), Times.Once); }
public ActionResult <ConcertDto> AddConcert(ConcertDto concertDto) { _concertLogic.AddConcert(concertDto); if (!ModelState.IsValid) { return(new BadRequestObjectResult(ModelState)); } return(Ok(concertDto)); }