Beispiel #1
0
        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();
        }
Beispiel #2
0
 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))));
 }
Beispiel #3
0
 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();
 }
Beispiel #4
0
 public void is_candidate_allows_interface_return_types()
 {
     HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ReturnsInterface(null)))
     .ShouldBeTrue();
 }