private Mock <IStateHandler> CreateStateHandler(string stateName)
        {
            var handler = new Mock <IStateHandler>();

            handler.Setup(x => x.StateName).Returns(stateName);

            _handlers.AddHandler(handler.Object);
            return(handler);
        }
Example #2
0
 public void AddHandler_ThrowsAnException_WhenHandlerIsNull()
 {
     Assert.Throws <ArgumentNullException>(
         () => _collection.AddHandler(null));
 }
Example #3
0
        private StateHandlerCollection GetHandlers()
        {
            if (_handlersCache == null)
            {
                _handlersCache = new StateHandlerCollection();

                var handlers = _getHandlersThunk(_connection);
                foreach (var handler in handlers)
                {
                    _handlersCache.AddHandler(handler);
                }
            }

            return _handlersCache;
        }