Exemplo n.º 1
0
        public void IDynamicObjectCreationExpression_PublicExtensionMethodTests()
        {
            // Test null argument
            IDynamicObjectCreationOperation nullDynamicExpression = null;

            Assert.Throws <ArgumentNullException>(() => nullDynamicExpression.GetArgumentName(0));
            Assert.Throws <ArgumentNullException>(() => nullDynamicExpression.GetArgumentRefKind(0));

            Func <
                ImmutableArray <IOperation>,
                ImmutableArray <string>,
                ImmutableArray <RefKind>,
                HasDynamicArgumentsExpression
                > createDynamicExpression = (arguments, argumentNames, argumentRefKinds) =>
                                            new DynamicObjectCreationOperation(
                initializer: null,
                arguments,
                argumentNames,
                argumentRefKinds,
                semanticModel: null,
                syntax: null,
                type: null,
                isImplicit: false
                );

            TestCore(createDynamicExpression);
        }
Exemplo n.º 2
0
        public void IDynamicObjectCreationExpression_PublicExtensionMethodTests()
        {
            // Test null argument
            IDynamicObjectCreationOperation nullDynamicExpression = null;

            Assert.Throws <ArgumentNullException>(() => nullDynamicExpression.GetArgumentName(0));
            Assert.Throws <ArgumentNullException>(() => nullDynamicExpression.GetArgumentRefKind(0));

            Func <ImmutableArray <IOperation>, ImmutableArray <string>, ImmutableArray <RefKind>, HasDynamicArgumentsExpression> createDynamicExpression =
                (arguments, argumentNames, argumentRefKinds) => new DynamicObjectCreationOperation(arguments, argumentNames, argumentRefKinds, null, null, null, null, null, false);

            TestCore(createDynamicExpression);
        }