예제 #1
0
        async Task <Unit> IRequestHandler <UpdateTestRun, Unit> .Handle(UpdateTestRun request, CancellationToken cancellationToken)
        {
            var testRun = new TestRun(request.TestRunId, request.EventId, request.Ordinal, request.TimeInMS, request.EntrantId, request.Created, request.MarshalId);

            testRun.SetPenalties(request.Penalties.ToArray());
            await testRunsRepository.UpdateTestRun(testRun, cancellationToken);

            await signalRNotifier.NewTestRun(testRun, cancellationToken);

            return(Unit.Value);
        }
예제 #2
0
        async Task <Unit> IRequestHandler <AddTestRun, Unit> .Handle(AddTestRun request, CancellationToken cancellationToken)
        {
            var marshal = await _autoTestContext.Marshals !.SingleAsync(a => a.Email == request.EmailAddress, cancellationToken);
            var testRun = new TestRun(request.TestRunId, request.EventId, request.Ordinal, request.TimeInMS, request.EntrantId, request.Created, marshal.MarshalId);

            testRun.SetPenalties(request.Penalties.ToArray());
            await testRunsRepository.AddTestRun(testRun, cancellationToken);

            await signalRNotifier.NewTestRun(testRun, cancellationToken);

            return(Unit.Value);
        }