示例#1
0
        public void AddressIsRequired()
        {
            DestinationFTP settings = CreateDefaultSettings();

            settings.address = null;
            ICollection <ValidationResult> result;

            DefinitionFTP.TryValidate(settings, out result);
            Check.That(result).CountIs(1);
        }
示例#2
0
        public void EncryptionMustBeValid()
        {
            DestinationFTP settings = CreateDefaultSettings();

            settings.encryption = null;
            ICollection <ValidationResult> result;

            DefinitionFTP.TryValidate(settings, out result);
            Check.That(result).CountIs(1);
            settings.encryption = "TLS";
            DefinitionFTP.TryValidate(settings, out result);
            Check.That(result).CountIs(0);
            settings.encryption = "SSL";
            DefinitionFTP.TryValidate(settings, out result);
            Check.That(result).CountIs(0);
        }
示例#3
0
        public void ModeHasValidValue()
        {
            DestinationFTP settings = CreateDefaultSettings();

            settings.mode = "test";
            ICollection <ValidationResult> validate;

            DestinationFTP.TryValidate(settings, out validate);
            Check.That(validate).CountIs(1);
            settings.mode = DefinitionFTP.ModeActive;
            DestinationFTP.TryValidate(settings, out validate);
            Check.That(validate).CountIs(0);
            settings.mode = DefinitionFTP.ModePassive;
            DestinationFTP.TryValidate(settings, out validate);
            Check.That(validate).CountIs(0);
        }
示例#4
0
        public void IfExistsHasValidValue()
        {
            DestinationFTP settings =
                CreateDefaultSettings();

            settings.actionIfFileExists = "test";
            var validate = settings.Validate(null);

            Check.That(validate).CountIs(1);
            settings.actionIfFileExists = DestinationFTP.IfExistsDontTransfer;
            validate = settings.Validate(null);
            Check.That(validate).CountIs(0);
            settings.actionIfFileExists = DestinationFTP.IfExistsOverwrite;
            validate = settings.Validate(null);
            Check.That(validate).CountIs(0);
        }