public DynamoAlarmGeneratorMockery()
        {
            Cloudwatch  = new Mock <IAmazonCloudWatch>();
            AlarmFinder = new Mock <IAlarmFinder>();

            SnsTopicCreator        = new Mock <ISnsTopicCreator>();
            SnsSubscriptionCreator = new Mock <ISnsSubscriptionCreator>();

            TableLoader = new Mock <IResourceSource <TableDescription> >();

            var logger             = new ConsoleAlarmLogger(false);
            var tableNamePopulator = new TableNamePopulator(logger, TableLoader.Object);
            var snsCreator         = new SnsCreator(SnsTopicCreator.Object, SnsSubscriptionCreator.Object);

            var tableAlarmCreator = new TableAlarmCreator(Cloudwatch.Object, AlarmFinder.Object, logger, Mock.Of <ILegacyAlarmTracker>());
            var indexAlarmCreator = new IndexAlarmCreator(Cloudwatch.Object, AlarmFinder.Object, logger, Mock.Of <ILegacyAlarmTracker>());

            AlarmGenerator = new DynamoAlarmGenerator(
                logger,
                tableNamePopulator,
                tableAlarmCreator,
                indexAlarmCreator,
                snsCreator,
                TableLoader.Object);
        }
示例#2
0
 public AlarmLoaderAndGenerator(
     IAlarmLogger logger,
     IConfigLoader configLoader,
     DynamoAlarmGenerator dynamoGenerator,
     OrphanTablesReporter orphanTablesReporter,
     SqsAlarmGenerator sqsGenerator,
     OrphanQueuesReporter orphanQueuesReporter,
     IAlarmCreator creator,
     IEnumerable <IServiceAlarmTasks> otherServices)
 {
     _logger               = logger;
     _configLoader         = configLoader;
     _dynamoGenerator      = dynamoGenerator;
     _orphanTablesReporter = orphanTablesReporter;
     _sqsGenerator         = sqsGenerator;
     _orphanQueuesReporter = orphanQueuesReporter;
     _creator              = creator;
     _otherServices        = otherServices;
 }