private static void LoadHalJson <T>( out IMessagePublisher publisher, out IMessageSubscriber <T> subscriber) where T : new() { var connectionString = "server=.;database=scratchpad;trusted_connection=true;"; var pubStoreSproc = "usp_StoreMessage"; var pubReceiveSproc = "usp_GetPageOfMessages"; var subGetSproc = "usp_GetLastMessageId"; var subUpdateSproc = "usp_UpdateLastMessageId"; //WriteColoredText("Connection string: "); //var connectionString = Console.ReadLine(); //WriteColoredText("Publish store sproc: "); //var pubStoreSproc = Console.ReadLine(); //WriteColoredText("Publish receive sproc: "); //var pubReceiveSproc = Console.ReadLine(); //WriteColoredText("Receive get sproc: "); //var subGetSproc = Console.ReadLine(); //WriteColoredText("Receive update sproc: "); //var subUpdateSproc = Console.ReadLine(); publisher = new SyndicationMessagePublisher(new SqlServerMessageRepository(connectionString, pubStoreSproc, pubReceiveSproc, 10)); var feedPositionRepo = new SqlServerFeedPositionRepository(connectionString, subGetSproc, subUpdateSproc); subscriber = new SyndicationPollingMessageReceiver <T>( new HalJsonMessageClient(feedPositionRepo, new HttpClientWrapper("http://localhost:16972/"), new MessageIdentifierFactory()), feedPositionRepo); }
public void Arrange() { _messageClient = new Mock <IMessageClient>(); _feedPositionRepository = new Mock <IFeedPositionRepository>(); _receiver = new SyndicationPollingMessageReceiver <TestMessage>(_messageClient.Object, _feedPositionRepository.Object); }