Ejemplo n.º 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();
        }
Ejemplo n.º 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))));
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 4
0
 public void is_candidate_allows_interface_return_types()
 {
     HandlerCall.IsCandidate(ReflectionHelper.GetMethod <ITargetHandler>(x => x.ReturnsInterface(null)))
     .ShouldBeTrue();
 }