Пример #1
0
        public void CalcularCostoKM_Distancia8888_RetornaCostoKmCeroPuntoTres()
        {
            //Arrange
            Double dDistancia = 8888;
            CalculadorTransporteMaritimoService calculadorTransporteMaritimoService = new CalculadorTransporteMaritimoService();

            //Act
            Double dCostoKm = calculadorTransporteMaritimoService.CalcularCostoKM(dDistancia);

            //Assert
            Assert.IsTrue(dCostoKm == 0.3);
        }
Пример #2
0
        public void CalcularTiempoTraslado_DatosPaquetesCorrectos_RetornaTiempoTrasladoMayorACero()
        {
            //Arrange
            CalculadorTransporteMaritimoService calculadorTransporteMaritimoService = new CalculadorTransporteMaritimoService();
            DatosPaqueteDTO datosPaqueteDTO = LlenarPedidoDatosCorrectos();

            //Act
            Double dTiempoTraslado = calculadorTransporteMaritimoService.CalcularTiempoTraslado(datosPaqueteDTO);

            //Assert
            Assert.IsTrue(dTiempoTraslado > 0);
        }
Пример #3
0
        public void CalcularTiempoTraslado_DatosPaquetesIncorrectos_RetornaTiempoTrasladoNaN()
        {
            //Arrange
            CalculadorTransporteMaritimoService calculadorTransporteMaritimoService = new CalculadorTransporteMaritimoService();
            DatosPaqueteDTO datosPaqueteDTO = LlenarPedidoDatosConError();

            //Act
            Double dTiempoTraslado = calculadorTransporteMaritimoService.CalcularTiempoTraslado(datosPaqueteDTO);

            //Assert
            Assert.IsTrue(Double.IsNaN(dTiempoTraslado));
        }
Пример #4
0
        public void CalcularCostoEnvio_DatosPaquetesIncorrectos_RetornaCostoEnvioCero()
        {
            //Arrange
            CalculadorTransporteMaritimoService calculadorTransporteMaritimoService = new CalculadorTransporteMaritimoService();
            DatosPaqueteDTO datosPaqueteDTO = LlenarPedidoDatosConError();

            //Act
            Double dCostoEnvio = calculadorTransporteMaritimoService.CalcularCostoEnvio(datosPaqueteDTO);

            //Assert
            Assert.IsTrue(dCostoEnvio == 0);
        }
        public ICalculadorTransporteService CrearInstancia(int _iTransporte)
        {
            ICalculadorTransporteService calculadorTransporteService = null;

            switch (_iTransporte)
            {
            case (int)EnumTransportes.Aéreo:
                calculadorTransporteService = new CalculadorTransporteAereoService();
                break;

            case (int)EnumTransportes.Marítimo:
                calculadorTransporteService = new CalculadorTransporteMaritimoService();
                break;

            case (int)EnumTransportes.Terrestre:
                calculadorTransporteService = new CalculadorTransporteTerrestreService();
                break;
            }
            return(calculadorTransporteService);
        }