public void TrySetCanceled_CallsOnCompleted()
        {
            // Arrange
            var op = new AsyncResultOverrides();

            // Act
            op.TrySetCanceled();

            // Assert
            Assert.True(op.OnCompletedCalled);
            Assert.True(op.OnStatusChangedCalled);
        }
示例#2
0
        public void Dispose_CallsDispose()
        {
            // Arrange
            var op = new AsyncResultOverrides();

            op.TrySetCompleted();

            // Act
            op.Dispose();

            // Assert
            Assert.True(op.DisposeCalled);
        }
        public void TrySetException_CallsOnCompleted()
        {
            // Arrange
            var e  = new Exception();
            var op = new AsyncResultOverrides();

            // Act
            op.TrySetException(e);

            // Assert
            Assert.Equal(e, op.OnCompletedException);
            Assert.True(op.OnCompletedCalled);
            Assert.True(op.OnStatusChangedCalled);
        }