예제 #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);
        }
예제 #4
0
        public void AlertingGroup_Succeeds_When_Targets_Is_Empty()
        {
            // arrange
            _config.AlertingGroups.First().Targets = new List <AlertTarget>();

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void SqsConfig_passess_When_Queue_LengthThreshold_Is_At_Max()
        {
            // arrange
            _sqs.Queues.First().LengthThreshold = 100000;

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
예제 #6
0
        public void AlertingGroup_Succeeds_With_Valid_Url_Target()
        {
            // arrange
            _config.AlertingGroups.First().Targets = new List <AlertTarget>
            {
                new AlertUrl("http://api.example.com/foo/bar")
            };

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
예제 #7
0
        public void AlertingGroup_Succeeds_With_Valid_Email_Target()
        {
            // arrange
            _config.AlertingGroups.First().Targets = new List <AlertTarget>
            {
                new AlertEmail("*****@*****.**")
            };

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void AlertingGroupSucceedsWhenQueueHasPattern()
        {
            // arrange
            _sqs.Queues = new List <Queue>
            {
                new Queue {
                    Pattern = "someQueue"
                }
            };

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void SqsConfig_OnlyQueue_Passes()
        {
            // arrange
            _config.AlertingGroups.First().Sqs = new Sqs
            {
                Queues = new List <Queue>
                {
                    new Queue {
                        Pattern = "QueuePattern"
                    }
                }
            };

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void SqsConfig_OnlyTable_Passes()
        {
            // arrange
            _config.AlertingGroups.First().DynamoDb = new DynamoDb
            {
                Tables = new List <Table>
                {
                    new Table {
                        Pattern = "TablePattern"
                    }
                }
            };

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
예제 #11
0
        public void AwsServicesConfig_OnlyResource_Passes()
        {
            // arrange
            _config.AlertingGroups.First().Services.Clear();
            _config.AlertingGroups.First().Services.Add("Lambda", new AwsServiceAlarms
            {
                Resources = new List <ResourceThresholds>
                {
                    new ResourceThresholds {
                        Pattern = "ResourcePattern"
                    }
                }
            });

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }
        public void AwsServicesConfig_OnlyResource_Passes()
        {
            // arrange
            _config.AlertingGroups.First().Services = new AlertingGroupServices()
            {
                Lambda = new AwsServiceAlarms <ResourceConfig>
                {
                    Resources = new List <ResourceThresholds <ResourceConfig> >
                    {
                        new ResourceThresholds <ResourceConfig> {
                            Pattern = "ResourcePattern"
                        }
                    }
                }
            };

            // act

            // assert
            ConfigAssert.IsValid(_config);
        }