private static Func <ISession <PrivateAuthentication>, ITest, Task <IReadOnlyDictionary <object, ResourceRecordPhaseEntry> > > BeforeTest(Func <IRequest <CreateRecordRequest, CreateRecordResponse> > requestSupplier)
        {
            return(async(session, test) =>
            {
                HrbcRecordCreator.IRecordEntries result = await HrbcRecordCreator.CreateRecords(requestSupplier)(session, test);

                IReadOnlyDictionary <object, List <PhaseEntryContent> > phaseResult = await HrbcPhaseEntryReader.ReadPhases(() => PhaseHelpers.InitPhaseEntryReader(result))(session, test);

                Dictionary <object, ResourceRecordPhaseEntry> combineResult = new Dictionary <object, ResourceRecordPhaseEntry>();
                return phaseResult.ToDictionary(x => x.Key, x => new ResourceRecordPhaseEntry(result[x.Key], phaseResult[x.Key]));
            });
        }
Ejemplo n.º 2
0
        private static Func <ISession <PrivateAuthentication>, ITest, Task <IReadOnlyDictionary <object, DeletedRecordMultiplePhaseEntry> > > BeforeTest(Func <IRequest <CreateRecordRequest, CreateRecordResponse> > requestSupplier, Dictionary <Enums.ResourceType, ulong> optionIds)
        {
            return(async(session, test) =>
            {
                HrbcRecordCreator.IRecordEntries result = await HrbcRecordCreator.CreateRecords(requestSupplier)(session, test);

                await HrbcRecordUpdater.UpdateRecords(() => initRecordsUpdater(result, optionIds))(session, test);

                IReadOnlyDictionary <object, List <PhaseEntryContent> > phaseResult = await HrbcPhaseEntryReader.ReadPhases(() => PhaseHelpers.InitPhaseEntryReader(result))(session, test);

                await HrbcRecordCreator.DeleteRecords(session, test, result);

                Dictionary <object, DeletedRecordMultiplePhaseEntry> combineResult = new Dictionary <object, DeletedRecordMultiplePhaseEntry>();
                return phaseResult.ToDictionary(x => x.Key, x => new DeletedRecordMultiplePhaseEntry(result[x.Key], x.Value));
            });
        }