Beispiel #1
0
        public void ConsultarStatusDrone()
        {
            var coordinateService = new CoordinateService();
            IPedidoDroneRepository pedidoDroneRepository = null;
            var context         = Substitute.For <DataContext>();
            var droneRepository = new MockDroneRepository(context);
            PedidoRepository pedidoRepository = null;

            var droneService = new DroneService(coordinateService, pedidoDroneRepository, droneRepository, pedidoRepository);

            var droneStatus = droneService.GetDroneStatus();

            Assert.Equal <int>(2, droneStatus.Count);
        }
        public async Task CriarDrone()
        {
            IDroneService _droneService = null;
            var           context       = ContextProvider <Drone> .GetContext(SetupTests.GetDrones());

            IDroneRepository _droneRepository = new MockDroneRepository(context);

            var droneFacade = new DroneFacade(_droneService, _droneRepository);


            var drone = new Drone(120, 80);
            await droneFacade.SaveDroneAsync(drone);

            Assert.True(drone.Perfomance == 160);
        }
        public void CriarDrone()
        {
            IDroneService    _droneService    = null;
            IDroneRepository _droneRepository = new MockDroneRepository();

            DroneFacade droneFacade = new DroneFacade(_droneService, _droneRepository);


            devboost.dronedelivery.felipe.DTO.Models.Drone drone = new devboost.dronedelivery.felipe.DTO.Models.Drone {
                Autonomia = 120, Velocidade = 80
            };
            droneFacade.SaveDrone(drone);

            Assert.True(drone.Perfomance == 160);
        }