private Mock <IStateHandler> CreateStateHandler(string stateName) { var handler = new Mock <IStateHandler>(); handler.Setup(x => x.StateName).Returns(stateName); _handlers.AddHandler(handler.Object); return(handler); }
public void AddHandler_ThrowsAnException_WhenHandlerIsNull() { Assert.Throws <ArgumentNullException>( () => _collection.AddHandler(null)); }
private StateHandlerCollection GetHandlers() { if (_handlersCache == null) { _handlersCache = new StateHandlerCollection(); var handlers = _getHandlersThunk(_connection); foreach (var handler in handlers) { _handlersCache.AddHandler(handler); } } return _handlersCache; }