예제 #1
0
        public async void GetFlightPlanTest(string id)
        {
            // Arrange.
            IDataAccess          demoDataAccess       = new DemoDataAccess();
            IFlightPlanManager   flightPlanManager    = new FlightPlanManager(demoDataAccess);
            FlightPlanController flightPlanController = new FlightPlanController(flightPlanManager);

            // Act.
            ActionResult <FlightPlan> actionResult = await flightPlanController.GetItem(id);

            ObjectResult result           = actionResult.Result as ObjectResult;
            FlightPlan   actualFlightPlan = result.Value as FlightPlan;

            // Assert.
            FlightPlan expectedFlightPlan = demoDataAccess.GetFlightPlan(id);

            Assert.AreEqual <FlightPlan>(actualFlightPlan, expectedFlightPlan);
        }