Exemplo n.º 1
0
        public void ValidateEnvelopesWidthAndHeightReturnsFalse(double width, double height)
        {
            EnvelopesValidator validator = new EnvelopesValidator();
            Envelope           envelope  = new Envelope(width, height);

            bool isValidExpected = validator.Validate(envelope).IsValid;

            Assert.False(isValidExpected);
        }
Exemplo n.º 2
0
        private Envelope SetEnvelope(double[] envelopeSizing)
        {
            EnvelopesValidator validator = new EnvelopesValidator();

            Envelope envelope = new Envelope(envelopeSizing);

            Log.Logger.Information($"Trying to create envelope with width:{envelope.Width} height:{envelope.Height}");

            if (validator.Validate(envelope).IsValid)
            {
                Log.Logger.Information($"Envelope width:{envelope.Width} height:{envelope.Height} is succesfully created");
                return(envelope);
            }

            Log.Logger.Warning($"Not valid envelope's width:{envelope.Width} height:{envelope.Height} parametrs input");

            throw new ArgumentException(UIMessages.INVALID_PARAMETRS);
        }