public async Task <TRes> Process(TMessage1 message, IBackbone <TRes, TProgress> backbone, IProgress <TProgress> progress, CancellationToken cancelationToken) { cancelationToken.ThrowIfCancellationRequested(); var message2 = await _Transformer.Transform(message, progress, cancelationToken); cancelationToken.ThrowIfCancellationRequested(); return(await backbone.Process(message2, progress, cancelationToken)); }
public async Task <bool> Process(string message, IBackbone <bool, int> backbone, IProgress <int> progress, CancellationToken cancelationToken) { if (!int.TryParse(message, out var res)) { return(false); } return(await backbone.Process(res, progress, cancelationToken)); }
public void Process_WithMessageOfUnknowType_ThrowException() { Func <Task> act = () => _BackBone.Process(new object(), _Progess, CancellationToken.None); act.Should().Throw <ArgumentException>(); }
public async Task Sample_Process_Int() { var res = await _BackBone.Process(20, null, CancellationToken.None); res.Should().BeTrue(); }