Exemplo n.º 1
0
        public CollectionWriterTestDescriptor(Settings settings, string collectionName, ItemDescription[] itemDescriptions, IEdmModel model)
        {
            this.TestDescriptorSettings = settings;
            this.collectionName         = collectionName;
            this.payloadItems           = itemDescriptions.Select(i => i.Item).ToArray();
            bool errorOnly;

            this.invocations            = CreateInvocations(payloadItems, out errorOnly);
            this.expectedResultCallback = CollectionWriterUtils.CreateExpectedResultCallback(collectionName, itemDescriptions, errorOnly, this.TestDescriptorSettings.ExpectedResultSettings);
            this.Model = model;
        }
Exemplo n.º 2
0
        public CollectionWriterTestDescriptor(Settings settings, string collectionName, object[] payloadItems, ExpectedException expectedException, IEdmModel model)
        {
            this.TestDescriptorSettings = settings;
            this.collectionName         = collectionName;
            this.payloadItems           = payloadItems;
            bool errorOnly;

            this.invocations            = CreateInvocations(payloadItems, out errorOnly);
            this.expectedResultCallback = CollectionWriterUtils.CreateExpectedErrorResultCallback(collectionName, tc => expectedException, this.TestDescriptorSettings.ExpectedResultSettings);
            this.Model = model;
        }
Exemplo n.º 3
0
        public CollectionWriterTestDescriptor(Settings settings, string collectionName, WriterInvocations[] invocations, Func <WriterTestConfiguration, ExpectedException> expectedExceptionFunc, ItemDescription collectionItem, ItemDescription errorItem, IEdmModel model)
        {
            this.TestDescriptorSettings = settings;
            this.collectionName         = collectionName;
            ItemDescription[] itemDescriptions;
            bool errorOnly;

            this.payloadItems = CreatePayloadItems(invocations, collectionItem, errorItem, out itemDescriptions, out errorOnly);
            this.invocations  = invocations;
            this.Model        = model;

            if (expectedExceptionFunc == null)
            {
                this.expectedResultCallback = CollectionWriterUtils.CreateExpectedResultCallback(collectionName, itemDescriptions, errorOnly, this.TestDescriptorSettings.ExpectedResultSettings);
            }
            else
            {
                this.expectedResultCallback = CollectionWriterUtils.CreateExpectedErrorResultCallback(collectionName, expectedExceptionFunc, this.TestDescriptorSettings.ExpectedResultSettings);
            }
        }