public void GroupThrowsNullExceptionWhenGroupNameIsNull()
 {
     var serializer = JsonUtility.CreateDefaultSerializer();
     var counters = new SignalRPerformanceCounterManager(new Mock<ILoggerFactory>().Object);
     var connection = new Mock<IConnection>();
     var invoker = new Mock<IHubPipelineInvoker>();
     var hubContext = new HubContext(connection.Object, invoker.Object, "test");
     
     Assert.Throws<ArgumentException>(() => hubContext.Clients.Group(null));
 }
        public void ClientThrowsNullExceptionWhenConnectionIdIsNull()
        {
            var serializer = JsonUtility.CreateDefaultSerializer();
            var counters = new PerformanceCounterManager();
            var connection = new Mock<IConnection>();
            var invoker = new Mock<IHubPipelineInvoker>();

            var hubContext = new HubContext(connection.Object, invoker.Object, "test");

            Assert.Throws<ArgumentException>(() => hubContext.Clients.Client(null));
        }
Exemple #3
0
        public void GroupThrowsNullExceptionWhenGroupNameIsNull()
        {
            Func<string, ClientHubInvocation, IList<string>, Task> send = (signal, value, exclude) => Task.Factory.StartNew(() => { });

            var serializer = new JsonNetSerializer();
            var counters = new PerformanceCounterManager();
            var connection = new Connection(new Mock<IMessageBus>().Object,
                    serializer,
                    "signal",
                    "connectonid",
                    new[] { "test" },
                    new string[] { },
                    new Mock<ITraceManager>().Object,
                    new AckHandler(completeAcksOnTimeout: false,
                                   ackThreshold: TimeSpan.Zero,
                                   ackInterval: TimeSpan.Zero),
                    counters,
                    new Mock<IProtectedData>().Object);

            var hubContext = new HubContext(send, "test", connection);

            Assert.Throws<ArgumentException>(() => hubContext.Clients.Group(null));
        }