public TimerServiceTestsFixture SetCallbackSuccess()
        {
            SuccessCallback.Setup(c => c(It.IsAny <DateTime>(), It.IsAny <CancellationToken>()))
            .Returns <DateTime, CancellationToken>((d, c) =>
            {
                CallbackTaskCompletionSource.TrySetResult(null);

                return(Task.CompletedTask);
            });

            return(this);
        }
        public TimerServiceTestsFixture SetCallbackError()
        {
            var isSuccess = false;

            SuccessCallback.Setup(c => c(It.IsAny <DateTime>(), It.IsAny <CancellationToken>()))
            .Returns <DateTime, CancellationToken>((d, c) =>
            {
                TimerServiceCancellationToken = c;

                if (!isSuccess)
                {
                    isSuccess = true;

                    throw Exception;
                }

                CallbackTaskCompletionSource.TrySetResult(null);

                return(Task.CompletedTask);
            });

            return(this);
        }