Example #1
0
        public void PublishTest()
        {
            ServerPump      target = new ServerPump(); // TODO: Initialize to an appropriate value
            ServiceBusEvent data   = null;             // TODO: Initialize to an appropriate value

            target.Publish(data);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Example #2
0
        public void HeartbeatTest()
        {
            ServerPump target   = new ServerPump(); // TODO: Initialize to an appropriate value
            Guid       clientId = new Guid();       // TODO: Initialize to an appropriate value

            target.Heartbeat(clientId);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Example #3
0
        static void Main(string[] args)
        {
            ServerPump pump = new ServerPump
            {
                Storage = new ShortBus.SQLStore.SubscriberStore()
            };

            pump.Start();
            Console.Write("Hit a key to exit..");
            Console.ReadKey();
            pump.Stop();
        }
Example #4
0
        public void Unsubscribe_removes_subscription_from_storage()
        {
            Mock <ISubscriberStore> subscribers = new Mock <ISubscriberStore>();
            Guid clientId = Guid.Empty;

            subscribers.Setup(foo => foo.RemoveSubscriber(clientId)).Verifiable();

            ServerPump target = new ServerPump();

            target.Storage = subscribers.Object;

            target.Unsubscribe(clientId);

            subscribers.Verify();
        }
Example #5
0
        public void Subscribe_adds_subscription_to_storage()
        {
            Mock <ISubscriberStore> subscribers = new Mock <ISubscriberStore>();
            Guid   clientId       = Guid.Empty;
            string clientEndpoint = GetFakeClientEndpoint(clientId);

            subscribers.Setup(foo => foo.AddSubscriber(clientId, clientEndpoint))
            .Returns(new Subscriber {
                LastSeen = DateTime.MinValue, Endpoint = clientEndpoint, SubscriberId = clientId
            })
            .Verifiable("Server pump did not persist subscriber");

            ServerPump target = new ServerPump();

            target.Storage = subscribers.Object;

            target.Subscribe(clientId, clientEndpoint);

            subscribers.Verify();
        }
Example #6
0
        public void ServerPumpConstructorTest()
        {
            ServerPump target = new ServerPump();

            Assert.Inconclusive("TODO: Implement code to verify target");
        }