public void CanGetDelegate() { var obj = new MockStructure(); var suffix = new NoArgsSuffix <Encapsulation.Structure>(() => obj); var del = suffix.Get(); Assert.IsNotNull(del); }
public void CanGetDelegate() { var obj = new object(); var suffix = new NoArgsSuffix <object>(() => obj); var del = suffix.Get(); Assert.IsNotNull(del); var delegateAsDelegate = del as Delegate; Assert.IsNotNull(delegateAsDelegate); }
public void CanGetDelegateValue() { var obj = new object(); var suffix = new NoArgsSuffix <object>(() => obj); var del = suffix.Get(); Assert.IsNotNull(del); var delegateAsDelegate = del as Delegate; Assert.IsNotNull(delegateAsDelegate); var value = delegateAsDelegate.DynamicInvoke(); Assert.IsNotNull(value); Assert.AreSame(obj, value); }
public void CanGetDelegateValueType() { const int VALUE = 12345; var suffix = new NoArgsSuffix <object>(() => VALUE); var del = suffix.Get(); Assert.IsNotNull(del); var delegateAsDelegate = del as Delegate; Assert.IsNotNull(delegateAsDelegate); var value = delegateAsDelegate.DynamicInvoke(); Assert.IsNotNull(value); Assert.IsInstanceOf <int>(value); Assert.AreEqual(VALUE, value); }
public void CanGetDelegateValue() { var obj = new MockStructure(); var suffix = new NoArgsSuffix <Encapsulation.Structure>(() => obj); var del = suffix.Get(); Assert.IsNotNull(del); cpu.PushStack(null); // dummy variable for ReverseStackArgs to pop cpu.PushStack(new KOSArgMarkerType()); del.Invoke(cpu); var value = del.Value; Assert.IsNotNull(value); Assert.AreSame(obj, value); }
public void CanGetDelegateValueType() { const int VALUE = 12345; var suffix = new NoArgsSuffix <Encapsulation.Structure>(() => ScalarValue.Create(VALUE)); var del = suffix.Get(); Assert.IsNotNull(del); cpu.PushStack(null); // dummy variable for ReverseStackArgs to pop cpu.PushStack(new KOSArgMarkerType()); del.Invoke(cpu); var value = del.Value; Assert.IsNotNull(value); Assert.IsInstanceOf <ScalarValue>(value); Assert.AreEqual(ScalarValue.Create(VALUE), value); }
public void CanCreate() { var suffix = new NoArgsSuffix <object>(() => new object()); Assert.IsNotNull(suffix.Get()); }
public void CanCreate() { var suffix = new NoArgsSuffix <Encapsulation.Structure>(() => new MockStructure()); Assert.IsNotNull(suffix.Get()); }