public async Task TestCreate()
        {
            var actual = await _passengerService.Create(_testPassenger);

            Assert.AreEqual(_testPassenger, actual, "Create returned a different passenger");
            var actualDb = _passengerService.Get(_testPassenger.Id);

            Assert.AreEqual(_testPassenger, actualDb, "Database returned a different passenger");
        }
コード例 #2
0
        public async Task <ActionResult <Passenger> > Create(Passenger passenger)
        {
            await _passengerService.Create(passenger);

            return(CreatedAtRoute("GetPassenger", new { id = passenger.Id }, passenger));
        }