TourDto CreateTestTour() { TourDto tour = new TourDto() { Id = 1, Description = "Test", AgeGroup = AgeGroup.Adult, Name = "Test" }; tour = _tourController.Create(tour); return(tour); }
public void TestCreate_ShouldSucceed() { //Set up dto TourDto tour = new TourDto() { Name = "Test", Description = "Test", AgeGroup = AgeGroup.Adult }; //Make test request TourDto tourResult = _controller.Create(tour); //Assert Values Assert.IsNotNull(tourResult); Assert.IsNotNull(tourResult.Id); Assert.IsTrue(tourResult.Id != 0); Assert.AreEqual(tour.Name, tourResult.Name); Assert.AreEqual(tour.Description, tourResult.Description); Assert.IsNotNull(tourResult.CreatedDate); Assert.IsNotNull(tourResult.ModifiedDate); }