コード例 #1
0
 public Start()
 {
     Mock.Get(_connection).Setup(m => m.Sender).Returns(_sender);
     Mock.Get(_task).Setup(t => t.Run(It.IsAny <Action>())).Callback <Action>((action) => action.Invoke());
     _args   = new ConnectionStartedEventArgs(_tokenSource.Token);
     _pinger = new Pinger(_task, _thread, _value, _milisecondsIntervalTime);
 }
コード例 #2
0
 public void Start(object sender, ConnectionStartedEventArgs args)
 {
     if (sender is IConnection)
     {
         _connection = sender as IConnection;
         _task.Run(() => Ping(args.Token));
     }
 }