public void handler_call_should_not_match_property_setters() { var handlerType = typeof(ITargetHandler); var property = handlerType.GetTypeInfo().GetProperty("Message"); var method = property.GetSetMethod(); HandlerCall.IsCandidate(method).ShouldBeFalse(); }
public void is_candidate() { ShouldBeBooleanExtensions.ShouldBeFalse(HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ZeroInZeroOut()))); ShouldBeBooleanExtensions.ShouldBeTrue(HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.OneInOneOut(null)))); ShouldBeBooleanExtensions.ShouldBeTrue(HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.OneInZeroOut(null)))); ShouldBeBooleanExtensions.ShouldBeFalse(HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ManyIn(null, null)))); ShouldBeBooleanExtensions.ShouldBeFalse(HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ReturnsValueType(null)))); }
public void is_candidate() { HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ZeroInZeroOut())).ShouldBeFalse(); HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.OneInOneOut(null))).ShouldBeTrue(); HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.OneInZeroOut(null))) .ShouldBeTrue(); HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ManyIn(null, null))) .ShouldBeFalse(); HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => (object)x.ReturnsValueType(null))) .ShouldBeFalse(); }
public void is_candidate_allows_interface_return_types() { HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ReturnsInterface(null))) .ShouldBeTrue(); }