本文整理汇总了C#中IFactory.NewServer方法的典型用法代码示例。如果您正苦于以下问题:C# IFactory.NewServer方法的具体用法?C# IFactory.NewServer怎么用?C# IFactory.NewServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFactory
的用法示例。
在下文中一共展示了IFactory.NewServer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InstantiateTests
public InstantiateTests()
{
_servers = new List<IServer>();
_log = Substitute.For<ILog>();
_server = Substitute.For<IServer>();
_servers.Add(_server);
_factory = Substitute.For<IFactory>();
_factory.NewServer(Arg.Any<string[]>()).Returns(_servers);
}
示例2: ConnectivityTests
public ConnectivityTests()
{
_opts = new Options();
_opts.uris = new List<string>() {cURL};
_servers = new List<IServer>();
_log = Substitute.For<ILog>();
_server = Substitute.For<IServer>();
_server.URL.Returns(cURL);
_server.Open().Returns(Task<bool>.FromResult(true));
_servers.Add(_server);
_factory = Substitute.For<IFactory>();
_factory.NewServer(Arg.Any<string[]>()).Returns(_servers);
}
示例3: SubscribeTests
public SubscribeTests()
{
_opts = new Options();
_opts.uris = new List<string>() {cURL};
_servers = new List<IServer>();
_log = Substitute.For<ILog>();
_msgr = Substitute.For<IMessenger>();
_server = Substitute.For<IServer>();
_server.IsConnected.Returns(true);
_server.URL.Returns(cURL);
_server.Open().Returns(Task<bool>.FromResult(true));
_server.Send(Arg.Any<string>())
.Returns(Task<int>.FromResult(1))
.AndDoes(x => { _server.Sent += Raise.EventWith(new dotnet_sockets.EventArgs<int>(1)); });
_servers.Add(_server);
_factory = Substitute.For<IFactory>();
_factory.NewServer(Arg.Any<string[]>()).Returns(_servers);
_factory.NewMessenger().Returns(_msgr);
}