Пример #1
0
        public void AlertingGroup_All_Resources_Succeeds()
        {
            // arrange

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void AwsServicesConfig_Full_Passes()
        {
            // arrange

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void DynamoDbConfig_Full_Passes()
        {
            // arrange

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void DynamoDbConfig_Fails_When_Threshold_Is_Too_High()
        {
            // arrange
            _dynamoDb.Threshold = 1.1;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Threshold of '1.1' must be less than or equal to one");
        }
Пример #5
0
        public void AlertingGroup_Fails_Without_Name()
        {
            // arrange
            _config.AlertingGroups.First().Name = null;

            // act

            // assert
            ConfigAssert.NotValid(_config, "AlertingGroup must have a name");
        }
        public void SqsConfig_Fails_If_Queue_Has_No_Name_Or_Pattern()
        {
            // arrange
            _sqs.Queues.First().Name = null;

            // act

            // assert
            ConfigAssert.NotValid(_config, "AlertingGroup 'someName' has a queue with no name or pattern");
        }
        public void SqsConfig_Fails_When_Sqs_Error_LengthThreshold_Is_Negative()
        {
            // arrange
            _sqs.Errors.LengthThreshold = -3;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Queue length of '-3' must be greater than zero");
        }
Пример #8
0
        public void Config_Fails_When_AlertingGroups_Is_Null()
        {
            // arrange
            _config.AlertingGroups = null;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Config must have alerting groups");
        }
Пример #9
0
        public void Config_Fails_When_Null()
        {
            // arrange
            _config = null;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Config cannot be null");
        }
        public void DynamoDbConfig_Fails_When_Threshold_Is_Too_Low()
        {
            // arrange
            _dynamoDb.Threshold = 0.0;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Threshold of '0' must be greater than zero");
        }
Пример #11
0
        public void Config_Fails_When_AlertingGroups_Is_Empty()
        {
            // arrange
            _config.AlertingGroups = new List <AlertingGroup>();

            // act

            // assert
            ConfigAssert.NotValid(_config, "Config must have alerting groups");
        }
        public void SqsConfig_Fails_When_Sqs_LengthThreshold_Is_TooHigh()
        {
            // arrange
            _sqs.LengthThreshold = 100001;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Queue length of '100001' is ridiculously high");
        }
        public void SqsConfig_Fails_When_Sqs_OldestMessageThreshold_Is_Negative()
        {
            // arrange
            _sqs.OldestMessageThreshold = -2;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Max age of '-2' must be greater than zero");
        }
        public void SqsConfig_Fails_When_Queue_Error_OldestMessageThreshold_Is_Negative()
        {
            // arrange
            _sqs.Queues.First().Errors.OldestMessageThreshold = -8;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Max age of '-8' must be greater than zero");
        }
        public void SqsConfig_Fails_When_Queue_Error_LengthThreshold_Is_TooHigh()
        {
            // arrange
            _sqs.Queues.First().Errors.LengthThreshold = 100007;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Queue length of '100007' is ridiculously high");
        }
        public void SqsConfig_passess_When_Queue_LengthThreshold_Is_At_Max()
        {
            // arrange
            _sqs.Queues.First().LengthThreshold = 100000;

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void SqsConfig_Fails_When_Queue_LengthThreshold_Is_Negative()
        {
            // arrange
            _sqs.Queues.First().LengthThreshold = -5;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Queue length of '-5' must be greater than zero");
        }
        public void SqsConfig_Fails_If_Queue_Is_Null()
        {
            // arrange
            _sqs.Queues.Add(null);

            // act

            // assert
            ConfigAssert.NotValid(_config, "AlertingGroup 'someName' has a null queue");
        }
        public void SqsConfig_Fails_When_Sqs_OldestMessageThreshold_Is_TooHigh()
        {
            // arrange
            _sqs.OldestMessageThreshold = SevenDays + 1;

            // act

            // assert
            ConfigAssert.NotValid(_config, "Max age of '604801' is ridiculously high");
        }
Пример #20
0
        public void AlertingGroup_Succeeds_When_Targets_Is_Empty()
        {
            // arrange
            _config.AlertingGroups.First().Targets = new List <AlertTarget>();

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
Пример #21
0
        public void AlertingGroup_Fails_When_Targets_Is_Null()
        {
            // arrange
            _config.AlertingGroups.First().Targets = null;

            // act

            // assert
            ConfigAssert.NotValid(_config, "AlertingGroup 'someName' must have targets");
        }
Пример #22
0
        public void AlertingGroup_Fails_Without_AlarmNameSuffix()
        {
            // arrange
            _config.AlertingGroups.First().AlarmNameSuffix = null;

            // act

            // assert
            ConfigAssert.NotValid(_config, "AlertingGroup 'someName' must have an alarm suffix");
        }
        public void DynamoDbConfig_Fails_When_Table_Is_Null()
        {
            // arrange
            _dynamoDb.Tables.Add(null);

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a null table");
        }
        public void DynamoDbConfig_Fails_When_Table_Has_No_Name_Or_Pattern()
        {
            // arrange
            _dynamoDb.Tables.First().Name = null;

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a table with no name or pattern");
        }
        public void AwsServicesConfig_Fails_When_ResourceThreshold_Is_Negative()
        {
            // arrange
            _awsServiceAlarms.Resources.First().Values.Add("invalidThreshold", -42);

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "Threshold of 'invalidThreshold' must be greater than zero");
        }
        public void AwsServicesConfig_Fails_When_There_Is_No_Name_Or_Pattern()
        {
            // arrange
            _awsServiceAlarms.Resources.First().Name = null;

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a 'Lambda' Service with no name or pattern");
        }
        public void AwsServicesConfig_Fails_When_Resource_Is_Null()
        {
            // arrange
            _awsServiceAlarms.Resources.Add(null);

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a 'Lambda' Service with null resource");
        }
        public void SqsConfig_Fails_If_Queue_Has_Name_And_Pattern()
        {
            // arrange
            _sqs.Queues.First().Pattern = "QueuePattern";

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a queue 'QueueName' with a name and a pattern");
        }
        public void FailsIfServiceHasNoResources()
        {
            // arrange
            _awsServiceAlarms.Resources = null;

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a 'Lambda' Service with missing Resources section");
        }
        public void DynamoDbConfig_Fails_When_Table_Has_Name_And_Pattern()
        {
            // arrange
            _dynamoDb.Tables.First().Pattern = "TablePattern";

            // act

            // assert
            ConfigAssert.NotValid(_config,
                                  "AlertingGroup 'someName' has a table 'TableName' with a name and a pattern");
        }