public void AddPassenger() { var newPassenger = new Passenger(); newPassenger.Id = 100; newPassenger.FirstName = "Lalit"; newPassenger.LastName = "Radadiya"; newPassenger.ContactNo = 1234; //var addedPassenger = _passengerController.Post(newPassenger); var res = mockData.Setup(x => x.CreatePassenger(newPassenger)).Returns("Successfully Added"); // Act var result = _passengerController.Post(newPassenger); // Assert Assert.NotNull(result); }
public void Test_AddUser() { var newPassenger = new Passenger(); newPassenger.FirstName = "Lalit"; newPassenger.LastName = "Radadiya"; newPassenger.ContactNo = 1234; var addedPassenger = _passengerController.Post(newPassenger); // Act var response = mockDataRepository.Setup( x => x.CreatePassenger(newPassenger) ) .Returns(addedPassenger); var result = _passengerController.Post(newPassenger); // Assert Assert.NotNull(result); }
public void Test_AddPassenger() { // Arrange var passenger = new TestingAssignment.Models.Passenger(); passenger.Id = new Guid(); passenger.FirstName = "Arjun"; passenger.LastName = "Chandarana"; passenger.PhoneNumber = "8735972921"; // Act var response = mockDataRepository.Setup(x => x.AddPassenger(passenger)).Returns(AddPassenger()); var result = _passengerController.Post(passenger); // Assert Assert.IsNotNull(result); }
public void Test_AddPassenger() { // Arrange var passenger = new Testing_Assignment_1.Models.Passenger(); passenger.Id = new Guid(); passenger.FirstName = "Rushi"; passenger.LastName = "Nariya"; passenger.PhoneNumber = "9864751235"; // Act var response = mockDataRepository.Setup(x => x.AddPassenger(passenger)).Returns(AddPassenger()); var result = _passengerController.Post(passenger); // Assert Assert.NotNull(result); }