public void Initialize() { hostObject = new Mock <IHostObject>(); hostObjectFactory = new Mock <IHostObjectFactory>(); logger = new Mock <ILogger>(); hostObjectFactory.Setup(f => f.CreateObject(It.IsAny <string>(), It.IsAny <ICommunication>())).Returns(hostObject.Object); sut = new BaseHostStub("net.pipe://some/address/here", hostObjectFactory.Object, logger.Object, 10); }