public AssertEqual ( ListenerEndpoint endpoint1, ListenerEndpoint endpoint2 ) : void | ||
endpoint1 | ListenerEndpoint | |
endpoint2 | ListenerEndpoint | |
return | void |
public void Can_Add_And_Remove_Listeners() { using (ServiceBusRuntime runtime = new ServiceBusRuntime(new DirectDeliveryCore(), new WcfManagementService())) { ServiceBusTest tester = new ServiceBusTest(runtime); tester.StartAndStop(() => { Service.Use <IServiceBusManagementService>(managementService => { SubscriptionEndpoint endpoint = new SubscriptionEndpoint(Guid.NewGuid(), "name of endpoint", "NamedPipeClient", "net.pipe://test/someservice/", typeof(IContract), new WcfProxyDispatcher(), null); managementService.Subscribe(endpoint); SubscriptionEndpoint added = managementService.ListSubscribers().First(); tester.AssertEqual(endpoint, added); managementService.Unsubscribe(endpoint.Id); Assert.IsEmpty(managementService.ListSubscribers()); }); }); } }
public void Can_Add_And_Remove_Subscriptions() { using(ServiceBusRuntime runtime = new ServiceBusRuntime(new DirectDeliveryCore(), new WcfManagementService())) { ServiceBusTest tester = new ServiceBusTest(runtime); tester.StartAndStop(() => { Service.Use<IServiceBusManagementService>(managementService => { ListenerEndpoint endpoint = new ListenerEndpoint(Guid.NewGuid(), "name of endpoint", "NamedPipeListener", "net.pipe://test/someservice/", typeof(IContract), new WcfServiceHostListener()); managementService.AddListener(endpoint); ListenerEndpoint added = managementService.ListListeners().First(); tester.AssertEqual(endpoint, added); managementService.RemoveListener(endpoint.Id); Assert.IsEmpty(managementService.ListListeners()); }); }); } }