Ejemplo n.º 1
0
        public bool IsValid(Notification notification)
        {
            var isRemoteOpValid = _sequence.OfType<IExecuteRemotely>().All(x => x.IsValid(notification));
            var isCompositeSeqValid = _sequence.OfType<CompositeSequence>().All(x => x.IsValid(notification));

            return isRemoteOpValid && isCompositeSeqValid;
        }
 public override bool IsValid(Notification notification)
 {
     try
     {
         var uri = new Uri(_url);
     }
     catch (Exception ex)
     {
         notification.AddError(new ValidationError(ex.Message));
         return false;
     }
     return true;
 }
        public void TestThatExecutionSequenceIsValid()
        {
            var config = new ConDepEnvConfig {EnvironmentName = "bogusEnv"};
            var server = new ServerConfig { Name = "jat-web03" };
            config.Servers = new[] { server };

            var sequenceManager = new ExecutionSequenceManager(config.Servers, new DefaultLoadBalancer());

            var settings = new ConDepSettings();
            settings.Config = config;

            var local = new LocalOperationsBuilder(sequenceManager.NewLocalSequence("Test"));
            //Configure.LocalOperations = local;
            _app.Configure(local, settings);

            var notification = new Notification();
            Assert.That(sequenceManager.IsValid(notification));
        }
 public bool IsValid(Notification notification)
 {
     return _sequence.All(x => x.IsValid(notification));
 }
 public override bool IsValid(Notification notification)
 {
     return !string.IsNullOrWhiteSpace(_webAppName)
         && !string.IsNullOrWhiteSpace(_webSiteName);
 }
 public override bool IsValid(Notification notification)
 {
     return !string.IsNullOrWhiteSpace(_appPoolName);
 }
 public void TestThatValidationsSucceedsWhenDirectoriesExists()
 {
     var operation = new PreCompileOperation("MyWebApp", _validWebAppPath, _validOutputPath, _buildManager.Object);
     var notification = new Notification();
     Assert.That(operation.IsValid(notification));
 }
 public void TestThat_ValidationFailsIfOrderOfConstructorArgumentsIsWrong()
 {
     var op = new MyRemoteOpWithWrongConstructorOrder("hello!", new ComplexObj());
     var notification = new Notification();
     Assert.That(op.IsValid(notification), Is.False);
     Assert.That(notification.HasErrors, Is.True);
 }
 public override bool IsValid(Notification notification)
 {
     return !string.IsNullOrWhiteSpace(_url) && Uri.IsWellFormedUriString(_url, UriKind.Absolute);
 }
Ejemplo n.º 10
0
 public bool IsValid(Notification notification)
 {
     try
     {
         var constructor = GetType().GetConstructor(ConstructorArguments.Select(x => x.GetType()).ToArray());
         if (constructor == null)
         {
             notification.AddError(new ValidationError(string.Format("Failed to extract constructor for operation {0}. Check the order of the parameters going into the base class. The order needs to be the same is in your constructor", GetType().Name)));
             return false;
         }
     }
     catch(Exception ex)
     {
         notification.AddError(new ValidationError(string.Format("Failed to extract constructor for operation {0}. Error message: {1}", GetType().Name, ex.Message)));
         return false;
     }
     return true;
 }
 public override bool IsValid(Notification notification)
 {
     return File.Exists(_certFile);
 }
 public void TestThat_ValidationOfMultipleConstructorsSucceeds()
 {
     var op = new MyRemoteOpWithMultipleConstructors("asdf", new ComplexObj());
     var notification = new Notification();
     Assert.That(op.IsValid(notification), Is.True);
     Assert.That(notification.HasErrors, Is.False);
 }
 public void TestThat_ValidationOfEmptyConstructorSecceeds()
 {
     var op = new MyRemoteOpWithMultipleConstructors();
     var notification = new Notification();
     Assert.That(op.IsValid(notification), Is.True);
     Assert.That(notification.HasErrors, Is.False);
 }
 public abstract bool IsValid(Notification notification);
 public void TestThatValidationsFailsWhenAppNameIsEmpty()
 {
     var operation = new PreCompileOperation("", _validWebAppPath, _validOutputPath, _buildManager.Object);
     var notification = new Notification();
     Assert.That(operation.IsValid(notification), Is.False);
 }
 public override bool IsValid(Notification notification)
 {
     return true;
 }
 public bool IsValid(Notification notification)
 {
     return _localSequences.All(x => x.IsValid(notification));
 }