Example #1
0
        public ComposedAwaitableConstraintTest()
        {
            _AwaitableConstraintCloned1 = Substitute.For <IAwaitableConstraint>();
            _AwaitableConstraintCloned2 = Substitute.For <IAwaitableConstraint>();

            _AwaitableConstraint1 = Substitute.For <IAwaitableConstraint>();
            _AwaitableConstraint2 = Substitute.For <IAwaitableConstraint>();
            _AwaitableConstraint1.Clone().Returns(_AwaitableConstraintCloned1);
            _AwaitableConstraint2.Clone().Returns(_AwaitableConstraintCloned2);

            _Disposable1 = Substitute.For <IDisposable>();
            _Disposable2 = Substitute.For <IDisposable>();
            _AwaitableConstraint1.WaitForReadiness(Arg.Any <CancellationToken>()).Returns(Task.FromResult(_Disposable1));
            _AwaitableConstraint2.WaitForReadiness(Arg.Any <CancellationToken>()).Returns(Task.FromResult(_Disposable2));
            _Composed = new ComposedAwaitableConstraint(_AwaitableConstraint1, _AwaitableConstraint2);
        }
Example #2
0
 public IAwaitableConstraint Clone()
 {
     return(new ComposedAwaitableConstraint(_AwaitableConstraint1.Clone(), _AwaitableConstraint2.Clone()));
 }
Example #3
0
 public IDispatcher Clone() => new TimeLimiter(_AwaitableConstraint.Clone());