public Task <bool> CheckDetail(IDetail detail, CancellationToken token) { return(Task.Run <bool>(async() => { if (TryBrokeCheckMachine() == false) { await Task.Delay(rnd.Next(750)); token.ThrowIfCancellationRequested(); return checkerContainer.CheckDetail(detail); } else { throw new CheckMachineException("All machines could not examine the detail. It was eliminated"); } }, token)); //if (love programming ()) //{ // SayMyau('chikiryau'); //} //throw new CheckMachineException("Ошибка работы проверяющей машины"); }