public virtual async Task ApplyVariationChanges(IApplyProviderVariations variationsApplication) { while (_variationChanges.Count > 0) { IVariationChange variationChange = _variationChanges.Dequeue(); await variationChange.Apply(variationsApplication); } }
public async Task QueuesVariationChangesToBeAppliedLater() { IVariationChange changeOne = NewChange(); IVariationChange changeTwo = NewChange(); IVariationChange changeThree = NewChange(); _variationContext.QueueVariationChange(changeThree); _variationContext.QueueVariationChange(changeOne); _variationContext.QueueVariationChange(changeTwo); await _variationContext.ApplyVariationChanges(_applyProviderVariations); Received.InOrder(async() => { await changeThree.Apply(_applyProviderVariations); await changeOne.Apply(_applyProviderVariations); await changeTwo.Apply(_applyProviderVariations); }); }
protected async Task WhenTheChangeIsApplied() { await Change.Apply(VariationsApplication); }