public void CreateReviewValidationTest(string text, DateTime publishDate) { //Arrange var mockUow = new Mock <IUnitOfWork>(); mockUow.Setup(a => a.Reviews.Create(It.IsAny <Review>())); //Act var service = new RentService(mockUow.Object); //Assert Assert.Throws <ValidationException>( () => service.CreateReview(new ReviewDTO { Text = text, PublishDate = publishDate })); }