Пример #1
0
 public void ExplicitBaseInterfaceMemberAccess_Method_Generic_TypeArgConstraintFailure()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("testInterface.ExplicitBaseInterfaceMethod('foo', 4, testInterface)"));
 }
Пример #2
0
 public void ExplicitBaseInterfaceMemberAccess_ExtensionMethod_GenericExplicitBase_MissingTypeArg()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("testInterface.ExplicitBaseInterfaceExtensionMethod(4)"));
 }
 public void BaseInterfaceMemberAccess_ExtensionMethod_NoMatchingOverload()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("testObject.BaseInterfaceExtensionMethod('foo', TestEnum.Second)"));
 }
Пример #4
0
 public void ScriptAccess_RenamedReadOnlyField_Write()
 {
     TestUtil.AssertException <UnauthorizedAccessException>(() => engine.Execute("testObject.renamedReadOnlyField = 7"));
 }
 public void BaseInterfaceMemberAccess_Property_Struct_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("testObject.BaseInterfaceStructProperty = System.DateTime.Now"));
 }
 public void BaseInterfaceMemberAccess_Method_GenericRedundant_MismatchedTypeArg()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("testObject.BaseInterfaceMethod(System.Int32, 'foo', 4, TestEnum.Second)"));
 }
 public void StaticMemberAccess_Property_Struct_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("StaticTestClass.StaticStructProperty = System.DateTime.Now"));
 }
 public void BaseInterfaceMemberAccess_Property_Scalar_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("testObject.BaseInterfaceScalarProperty = TestEnum.Second"));
 }
 public void StaticMemberAccess_Property_Scalar_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("StaticTestClass.StaticScalarProperty = TestEnum.Second"));
 }
 public void StaticMemberAccess_Property_Enum_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("StaticTestClass.StaticEnumProperty = 1"));
 }
 public void StaticMemberAccess_Property_Scalar_Overflow()
 {
     TestUtil.AssertException <OverflowException>(() => engine.Execute("StaticTestClass.StaticScalarProperty = 54321"));
 }
 public void StaticMemberAccess_Property_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("StaticTestClass.StaticProperty = host.newArr(System.Double, 5)"));
 }
Пример #13
0
 public void ScriptAccess_RenamedReadOnlyProperty_Write()
 {
     TestUtil.AssertException <UnauthorizedAccessException>(() => engine.Execute("testObject.renamedReadOnlyProperty = Guid.NewGuid()"));
 }
 public void BaseInterfaceMemberAccess_Property_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("testObject.BaseInterfaceProperty = host.newArr(System.Double, 5)"));
 }
 public void StaticMemberAccess_ReadOnlyProperty_Write()
 {
     TestUtil.AssertException <UnauthorizedAccessException>(() => engine.Execute("StaticTestClass.StaticReadOnlyProperty = 2"));
 }
 public void BaseInterfaceMemberAccess_Property_Scalar_Overflow()
 {
     TestUtil.AssertException <OverflowException>(() => engine.Execute("testObject.BaseInterfaceScalarProperty = 54321"));
 }
 public void StaticMemberAccess_Method_NoMatchingOverload()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("StaticTestClass.StaticMethod('foo', TestEnum.Second)"));
 }
 public void BaseInterfaceMemberAccess_Property_Enum_BadAssignment()
 {
     TestUtil.AssertException <ArgumentException>(() => engine.Execute("testObject.BaseInterfaceEnumProperty = 1"));
 }
 public void StaticMemberAccess_Method_Generic_TypeArgConstraintFailure()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("StaticTestClass.StaticMethod('foo', 4, StaticTestClass)"));
 }
 public void BaseInterfaceMemberAccess_ReadOnlyProperty_Write()
 {
     TestUtil.AssertException <UnauthorizedAccessException>(() => engine.Execute("testObject.BaseInterfaceReadOnlyProperty = 2"));
 }
 public void StaticMemberAccess_Method_GenericRedundant_MismatchedTypeArg()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("StaticTestClass.StaticMethod(System.Int32, 'foo', 4, TestEnum.Second)"));
 }
 public void BaseInterfaceMemberAccess_Method_GenericExplicit_MissingTypeArg()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("testObject.BaseInterfaceMethod(4)"));
 }
 public void StaticMemberAccess_Method_GenericExplicit_MissingTypeArg()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("StaticTestClass.StaticMethod(4)"));
 }
 public void BaseInterfaceMemberAccess_ExtensionMethod_Generic_TypeArgConstraintFailure()
 {
     TestUtil.AssertException <RuntimeBinderException>(() => engine.Execute("testObject.BaseInterfaceExtensionMethod('foo', 4, testObject)"));
 }
Пример #25
0
 public void ScriptAccess_BlockedOverloadedMethod()
 {
     // the property exists due to the overload, but invocation fails because the bound method is blocked
     Assert.AreNotSame(Undefined.Value, engine.Evaluate("testObject.BlockedOverloadedMethod"));
     TestUtil.AssertException <MissingMemberException>(() => engine.Execute("testObject.BlockedOverloadedMethod('foo')"));
 }