public async Task CanCallOnChangeSetItemProcessedAsync()
 {
     var testClass         = new ConventionBasedChangeSetItemFilter(typeof(EmptyApi));
     var context           = new SubmitContext(new EmptyApi(serviceProvider), new ChangeSet());
     var cancellationToken = CancellationToken.None;
     await testClass.OnChangeSetItemProcessedAsync(context, dataModificationItem, cancellationToken);
 }
 public async Task CannotCallOnChangeSetItemProcessedAsyncWithNullItem()
 {
     var         testClass = new ConventionBasedChangeSetItemFilter(typeof(EmptyApi));
     Func <Task> act       = () => testClass.OnChangeSetItemProcessedAsync(
         new SubmitContext(new EmptyApi(serviceProvider), new ChangeSet()),
         default(ChangeSetItem),
         CancellationToken.None);
     await act.Should().ThrowAsync <ArgumentNullException>();
 }
 public async Task CannotCallOnChangeSetItemProcessedAsyncWithNullContext()
 {
     var         testClass = new ConventionBasedChangeSetItemFilter(typeof(EmptyApi));
     Func <Task> act       = () => testClass.OnChangeSetItemProcessedAsync(
         default(SubmitContext),
         dataModificationItem,
         CancellationToken.None);
     await act.Should().ThrowAsync <ArgumentNullException>();
 }
        public async Task OnChangeSetItemProcessedAsyncInvokesConventionMethod()
        {
            var api               = new InsertApi(serviceProvider);
            var context           = new SubmitContext(api, new ChangeSet());
            var cancellationToken = CancellationToken.None;
            var testClass         = new ConventionBasedChangeSetItemFilter(typeof(InsertApi));
            await testClass.OnChangeSetItemProcessedAsync(context, dataModificationItem, cancellationToken);

            api.InvocationCount.Should().Be(1);
        }