コード例 #1
0
        public void Setup()
        {
            ObjectFactory.Configure(x =>
            {
                x.For <IServiceBus>().Singleton().Use <MockedServiceBus>();
                x.For <IPostActionSpecification>().Use <PublishEdiAsnSentSpecification>();
                x.For <IExecutePostConsumeAction>().Use <ExecutePostConsumeAction>();
            });

            ServiceLocator.SetLocatorProvider(() => new StructureMapServiceLocator(ObjectFactory.Container));

            Lines = new List <ShippedLine>();
            Lines.Add(new ShippedLine()
            {
                LineNumber = "line1"
            });
            Lines.Add(new ShippedLine()
            {
                LineNumber = "line2"
            });
            Lines.Add(new ShippedLine()
            {
                LineNumber = "line3"
            });

            DefaultOrderHasBeenShippedMessage = new OrderHasBeenShippedMessage()
            {
                BOL           = BOL,
                ControlNumber = ControlNumber,
                Lines         = Lines
            };

            _sut = ServiceLocator.Current.GetInstance <IExecutePostConsumeAction>();
        }
コード例 #2
0
        public void should_throw_exception_when_no_specifications_are_resolved()
        {
            ObjectFactory.Initialize(x =>
            {
                x.For <IExecutePostConsumeAction>().Use <ExecutePostConsumeAction>();
            });

            _sut = ServiceLocator.Current.GetInstance <IExecutePostConsumeAction>();
            _sut.Execute(DefaultOrderHasBeenShippedMessage);
        }
コード例 #3
0
 public Subscriber(IBusinessPartnerResolver <T> businessPartnerResolver,
                   ICreateEdiDocumentFrom <T> createEdiDocumentFrom,
                   IEdiDocumentSaver ediDocumentSaver,
                   IAcceptMessages acceptMessages,
                   IExecutePostConsumeAction postConsumeAction)
 {
     _businessPartnerResolver = businessPartnerResolver;
     _acceptMessages          = acceptMessages;
     _postConsumeAction       = postConsumeAction;
     _createEdiDocumentFrom   = createEdiDocumentFrom;
     _ediDocumentSaver        = ediDocumentSaver;
 }