public void CreateOrderValidationTest(string userId, string firstName, string lastName, string phoneNumber, string pickUpAdress, DateTime fromDate, DateTime toDate, int?carId) { //Arrange var mockUow = new Mock <IUnitOfWork>(); mockUow.Setup(a => a.Orders.Create(It.IsAny <Order>())); //Act var service = new RentService(mockUow.Object); //Assert Assert.Throws <ValidationException>( () => service.CreateOrder(new OrderDTO { UserId = userId, FirstName = firstName, LastName = lastName, PhoneNumber = phoneNumber, FromDate = fromDate, ToDate = toDate, PickUpAddress = pickUpAdress }, carId)); }