Beispiel #1
0
        public void When_ApprovedCompleted_And_NotCustomerOrderCompleted_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                ApprovedCompleted      = true,
                CustomerOrderCompleted = false
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Etapa 'Aprobado' no puede estar completada si aun no está completada la Etapa anterior", result.ErrorMessage);
        }
Beispiel #2
0
        public void When_ApprovedRealDate_LessThan_CustomerOrderRealDate_And_ApprovedRealDateNotNull_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                ApprovedRealDate      = DateTime.Now.AddDays(-1),
                CustomerOrderRealDate = DateTime.Now
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Fecha Real de 'Aprobado' no puede ser menor a la Fecha Real de la la Etapa anterior", result.ErrorMessage);
        }
Beispiel #3
0
        public void When_InProductionEnabled_And_InProductionRealDateNotNull_And_ApprovedRealDateIsNll_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                InProductionEnabled  = true,
                InProductionRealDate = DateTime.Now,
                ApprovedRealDate     = null
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Fecha Real de 'En Px' no puede ser menor a la Fecha Real de la Etapa anterior", result.ErrorMessage);
        }
Beispiel #4
0
        public void When_DeliveredEstimatedDate_LessThan_InProductionEstimatedDate_And_InProductionEnabled_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                DeliveredEstimatedDate    = DateTime.Now.AddDays(-1),
                InProductionEstimatedDate = DateTime.Now,
                InProductionEnabled       = true
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Fecha Estimada de 'Entregado' no puede ser menor a la Fecha Estimada de la Etapa anterior", result.ErrorMessage);
        }
Beispiel #5
0
        public void When_ETAEnabled_And_ETAEstimatedDate_LessThan_ApprovedEstimatedDate_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                ETAEnabled            = true,
                ETAEstimatedDate      = DateTime.Now.AddDays(-1),
                ApprovedEstimatedDate = DateTime.Now
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Fecha Estimada de 'Puerto ETA' no puede ser menor a la Fecha Estimada de la Etapa anterior", result.ErrorMessage);
        }
Beispiel #6
0
        public void When_InProductionEnabled_And_InProductionCompleted_And_NotApprovedCompleted_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                InProductionEnabled   = true,
                InProductionCompleted = true,
                ApprovedCompleted     = false
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Etapa 'En Px' no puede estar completada si aun no está completada la Etapa anterior", result.ErrorMessage);
        }
Beispiel #7
0
        public void When_DeliveredCompleted_And_ETDEnabled_And_NotETDCompleted_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                DeliveredCompleted = true,
                ETDEnabled         = true,
                ETDCompleted       = false
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Etapa 'Entregado' no puede estar completada si aun no está completada la Etapa anterior", result.ErrorMessage);
        }
Beispiel #8
0
        public void When_NationalizedEnabled_And_NationalizedEstimatedDate_LessThan_ETDEstimatedDate_And_ETDEnabled_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                NationalizedEnabled       = true,
                NationalizedEstimatedDate = DateTime.Now.AddDays(-1),
                ETDEstimatedDate          = DateTime.Now,
                ETDEnabled = true
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Fecha Estimada de 'Nacionalizado' no puede ser menor a la Fecha Estimada de la Etapa anterior", result.ErrorMessage);
        }
Beispiel #9
0
        public void When_ETDEnabled_And_ETDRealDateNotNull_And_InProductionRealDate_LessThan_ApprovedRealDate_And_InProductionEnabled_And_ETDRealDate_GreatherThan_InProductionRealDate_Then_ThrowValidationError()
        {
            // Arrange
            ShipmentTracking shipmentTracking = new ShipmentTracking
            {
                ETDEnabled           = true,
                ETDRealDate          = DateTime.Now,
                ApprovedRealDate     = DateTime.Now,
                InProductionRealDate = DateTime.Now.AddDays(-1),
                InProductionEnabled  = true
            };

            // Act
            ValidationResult result = ShipmentTrackingRules.ValidateShipmentTracking(shipmentTracking, null);

            // Assert
            Assert.AreEqual("La Fecha Real de 'Embarcado ETD' no puede ser menor a la Fecha Real de la Etapa anterior", result.ErrorMessage);
        }