示例#1
0
 public Stream(
     IEventStore store,
     IEventSerializer serializer,
     StreamId id,
     IMetadataContext metadataContext)
 {
     _store           = store ?? throw new ArgumentNullException(nameof(store));
     _serializer      = serializer ?? throw new ArgumentNullException(nameof(serializer));
     Id               = id;
     _metadataContext = metadataContext;
 }
示例#2
0
 public JobsHelper(IMetadataContext context,
                   IDownloadToStream downloader,
                   ICustomMetadataReader reader, IBackgroundJobClient client,
                   IPostNotificationSender sender)
 {
     _context    = context;
     _downloader = downloader;
     _reader     = reader;
     _client     = client;
     _sender     = sender;
 }
 public JobsHelper(IMetadataContext context, 
     IDownloadToStream downloader, 
     ICustomMetadataReader reader, IBackgroundJobClient client, 
     IPostNotificationSender sender)
 {
     _context = context;
     _downloader = downloader;
     _reader = reader;
     _client = client;
     _sender = sender;
 }
示例#4
0
 public EventSourcedRepository(
     IAggregateStreamIdResolver streamIdResolver,
     IAggregateFactory <TAggregate, TId> aggregateFactory,
     IEventStore eventStore,
     IEventSerializer serializer,
     IMetadataContext metadataContext = null)
 {
     _streamIdResolver = streamIdResolver ?? throw new ArgumentNullException(nameof(streamIdResolver));
     _aggregateFactory = aggregateFactory ?? throw new ArgumentNullException(nameof(aggregateFactory));
     _serializer       = serializer ?? throw new ArgumentNullException(nameof(serializer));
     _metadataContext  = metadataContext ?? NullMetadataContext.Instance;
     _store            = eventStore ?? throw new ArgumentNullException(nameof(eventStore));
 }
        public void Setup()
        {
            _client = Mock.Of <IBackgroundJobClient>();

            _context         = Mock.Of <IMetadataContext>();
            _scheduledImages = Mock.Of <DbSet <ScheduledImage> >();

            _postNotificationSender = Mock.Of <IPostNotificationSender>();

            var imageMetadataTags = Mock.Of <DbSet <ImageMetadataTag> >();

            Mock.Get(_context).Setup(ctx => ctx.ScheduledImages).Returns(_scheduledImages);
            Mock.Get(_context).Setup(ctx => ctx.ImageMetadataTags).Returns(imageMetadataTags);
        }
        public void Setup()
        {
            _context         = Mock.Of <IMetadataContext>();
            _scheduledImages = Mock.Of <DbSet <ScheduledImage> >();

            _downloader = Mock.Of <IDownloadToStream>();

            _metadataReader = Mock.Of <ICustomMetadataReader>();

            _client = Mock.Of <IBackgroundJobClient>();

            _postNotificationSender = Mock.Of <IPostNotificationSender>();

            Mock.Get(_scheduledImages).Setup(si => si.Find(It.IsAny <int>())).Returns(new ScheduledImage());
            Mock.Get(_context).Setup(c => c.ScheduledImages).Returns(_scheduledImages);
            Mock.Get(_metadataReader).Setup(m => m.ReadFromStream(It.IsAny <MemoryStream>())).Returns(new List <ImageMetadataTag>());
        }
示例#7
0
 public SnapshotableRepository(
     IAggregateStreamIdResolver streamIdResolver,
     ITriggerThresholdResolver thresholdResolver,
     SnapshotableAggregateFactory <TAggregate, TId> aggregateFactory,
     IEventStore eventStore,
     IEventSerializer serializer,
     ISnapshotStore snapshotStore,
     IMetadataContext metadataContext = null)
 {
     _streamIdResolver  = streamIdResolver ?? throw new ArgumentNullException(nameof(streamIdResolver));
     _thresholdResolver = thresholdResolver ?? throw new ArgumentNullException(nameof(thresholdResolver));
     _aggregateFactory  = aggregateFactory ?? throw new ArgumentNullException(nameof(aggregateFactory));
     _serializer        = serializer ?? throw new ArgumentNullException(nameof(serializer));
     _metadataContext   = metadataContext ?? NullMetadataContext.Instance;
     _eventStore        = eventStore ?? throw new ArgumentNullException(nameof(eventStore));
     _snapshotStore     = snapshotStore ?? throw new ArgumentException(nameof(snapshotStore));
 }
        public void Setup()
        {
            _context = Mock.Of<IMetadataContext>();
            _scheduledImages = Mock.Of<DbSet<ScheduledImage>>();

            _downloader = Mock.Of<IDownloadToStream>();

            _metadataReader = Mock.Of<ICustomMetadataReader>();

            _client = Mock.Of<IBackgroundJobClient>();

            _postNotificationSender = Mock.Of<IPostNotificationSender>();

            Mock.Get(_scheduledImages).Setup(si => si.Find(It.IsAny<int>())).Returns(new ScheduledImage());
            Mock.Get(_context).Setup(c => c.ScheduledImages).Returns(_scheduledImages);
            Mock.Get(_metadataReader).Setup(m => m.ReadFromStream(It.IsAny<MemoryStream>())).Returns(new List<ImageMetadataTag>());
        }
 public ScheduledImagesController(IMetadataContext context)
 {
     _context = context;
 }
示例#10
0
 public ScheduledImagesController(IMetadataContext context)
 {
     _context = context;
 }
示例#11
0
 public MetadataRepository(IMetadataContext context)
 {
     _context = context;
 }
示例#12
0
 public HomeController(IMetadataContext context)
 {
     _context = context;
 }
        public void Setup()
        {
            _client = Mock.Of<IBackgroundJobClient>();

            _context = Mock.Of<IMetadataContext>();
            _scheduledImages = Mock.Of<DbSet<ScheduledImage>>();

            _postNotificationSender = Mock.Of<IPostNotificationSender>();

            var imageMetadataTags = Mock.Of<DbSet<ImageMetadataTag>>();
            Mock.Get(_context).Setup(ctx => ctx.ScheduledImages).Returns(_scheduledImages);
            Mock.Get(_context).Setup(ctx => ctx.ImageMetadataTags).Returns(imageMetadataTags);
        }
 public MetadataRepository(IMetadataContext context)
 {
     _context = context;
 }
 public SchedulerController(IMetadataContext context, IBackgroundJobClient backgroundJobClient, IPostNotificationSender postNotificationSender)
 {
     _context                = context;
     _backgroundJobClient    = backgroundJobClient;
     _postNotificationSender = postNotificationSender;
 }
 public SchedulerController(IMetadataContext context, IBackgroundJobClient backgroundJobClient, IPostNotificationSender postNotificationSender)
 {
     _context = context;
     _backgroundJobClient = backgroundJobClient;
     _postNotificationSender = postNotificationSender;
 }
 public HomeController(IMetadataContext context)
 {
     _context = context;
 }