private void AddService <TServiceModel, TSource, TDataProvider, TResourceAlarmConfig, TAlarmBuilder>(
            Func <WatchmanConfiguration, WatchmanServiceConfiguration <TResourceAlarmConfig> > mapper,
            IEnumerable <AlarmDefinition> defaults
            )
            where TServiceModel : class
            where TSource : IResourceSource <TServiceModel>
            where TDataProvider : IAlarmDimensionProvider <TServiceModel>,
        IResourceAttributesProvider <TServiceModel, TResourceAlarmConfig>
            where TResourceAlarmConfig : class, IServiceAlarmConfig <TResourceAlarmConfig>, new()
            where TAlarmBuilder : IResourceAlarmGenerator <TServiceModel, TResourceAlarmConfig>
        {
            For <IResourceSource <TServiceModel> >().Use <TSource>();
            For <IAlarmDimensionProvider <TServiceModel> >().Use <TDataProvider>();
            For <IResourceAttributesProvider <TServiceModel, TResourceAlarmConfig> >().Use <TDataProvider>();

            For <IServiceAlarmTasks>()
            .Use <ServiceAlarmTasks <TServiceModel, TResourceAlarmConfig> >()
            .Ctor <Func <WatchmanConfiguration, WatchmanServiceConfiguration <TResourceAlarmConfig> > >()
            .Is(mapper);

            For <IResourceAlarmGenerator <TServiceModel, TResourceAlarmConfig> >().Use <TAlarmBuilder>();

            if (defaults != null)
            {
                For <AlarmDefaults <TServiceModel> >().Use(_ => AlarmDefaults <TServiceModel> .FromDefaults(defaults));
            }
        }
 private ResourceAlarmGenerator <FakeResource, ResourceConfig> CreateSut(IEnumerable <AlarmDefinition> defaults)
 {
     return(new ResourceAlarmGenerator <FakeResource, ResourceConfig>(
                _fakeTableSource.Object,
                _fakeDimensionProvider.Object,
                AlarmDefaults <FakeResource> .FromDefaults(defaults),
                _fakeAttributeProvider.Object));
 }