public void A_comple_Sale_command_should_be_sent_to_our_backend()
        {
            var bus = MockRepository.GenerateStub<IBus>();
            var orderDispatcher = new OrderDispatcher(bus);

            orderDispatcher.Place(34);

            bus.AssertWasSent<CompleteSaleCommand>(x=>x.ProductID == 34);
        }
示例#2
0
        static void Main(string[] args)
        {
            string line = "";
            IBus bus = NServiceBus.Configure.With()
                .Log4Net()
                .DefaultBuilder()
                .XmlSerializer()
                .MsmqTransport()
                .IsTransactional(true)
                .UnicastBus()
                .LoadMessageHandlers()
                .CreateBus()
                .Start();

            OrderDispatcher orderDispatcher = new OrderDispatcher(bus);

            Console.WriteLine("Please enter a product id");
            while((line = Console.ReadLine()) != "q")
            {
                int productId = int.Parse(line);

                orderDispatcher.Place(productId);
            }
        }