Ejemplo n.º 1
0
        public void Validate()
        {
            if (string.IsNullOrWhiteSpace(Server))
            {
                throw new ArgumentException("Server cannot be empty", nameof(Server));
            }

            if (string.IsNullOrWhiteSpace(UserName))
            {
                throw new ArgumentException("Server cannot be empty", nameof(Server));
            }

            if (string.IsNullOrWhiteSpace(Password))
            {
                throw new ArgumentException("Server cannot be empty", nameof(Server));
            }

            if (!Port.Between(1, 65535, true))
            {
                throw new AggregateException("Port must be between 1 and 65535");
            }
        }