public void GetMember_Static_MethodCallExpression() { var member = NormalizingMemberInfoFromExpressionUtility.GetMember(() => DomainType.StaticMethod()); var expected = typeof(DomainType).GetMember("StaticMethod").Single(); Assert.That(member, Is.EqualTo(expected)); }
public void GetMethod_Static() { var member = MemberInfoFromExpressionUtility.GetMethod(() => DomainType.StaticMethod()); var expected = typeof(DomainType).GetMethod("StaticMethod"); Assert.That(member, Is.EqualTo(expected)); }
public void GetProperty_Static_NonMemberExpression() { NormalizingMemberInfoFromExpressionUtility.GetProperty(() => DomainType.StaticMethod()); }
public void GetGenericMethodDefinition_Static_NonGenericMethod() { NormalizingMemberInfoFromExpressionUtility.GetGenericMethodDefinition(() => DomainType.StaticMethod()); }
public void GetField_Static_NonMemberExpression() { MemberInfoFromExpressionUtility.GetField(() => DomainType.StaticMethod()); }
public void VisitNewDelegate_Static() { var delegateType = typeof(Action); var delegateCtor = delegateType.GetConstructors().Single(); var method = NormalizingMemberInfoFromExpressionUtility.GetMethod(() => DomainType.StaticMethod()); var expression = new NewDelegateExpression(delegateType, null, method); _ilGeneratorMock.Setup(mock => mock.Emit(OpCodes.Ldnull)).Verifiable(); _ilGeneratorMock.Setup(mock => mock.Emit(OpCodes.Ldftn, expression.Method)).Verifiable(); _ilGeneratorMock.Setup(mock => mock.Emit(OpCodes.Newobj, delegateCtor)).Verifiable(); _emitter.VisitNewDelegate(expression); _ilGeneratorMock.Verify(); }