Beispiel #1
0
        protected override void establish_context()
        {
            observation_specification = dependency <IObservationSpecification>();
            observation_specification.setup_result(x => x.IsSatisfiedBy(null)).IgnoreArguments().Return(true);

            sut = create_sut();
        }
 protected override void establish_context()
 {
     options = dependency <IReportOptions>();
     observation_specification = dependency <IObservationSpecification>();
     concern_factory           = dependency <IConcernFactory>();
     specific_concern          = dependency <IConcern>();
 }
 public IConcern create_concern_from(Type type_with_concern, IObservationSpecification obseration_specification, IObservationReport observations)
 {
     return new Concern(type_with_concern.concern().concerned_with,
                         type_with_concern.concern().story_key,
                        type_with_concern.Name.as_bdd_style_name(),
                        type_with_concern.all_members_that_meet(obseration_specification).as_observations(type_with_concern.Name,observations)                               
                        );
 }
Beispiel #4
0
 public static IEnumerable <MethodInfo> all_methods_that_meet(this Type type, IObservationSpecification observation_specification)
 {
     return(type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public)
            .Where(observation_specification.IsSatisfiedBy));
 }
 public OrObservationSpecification(IObservationSpecification left_side, IObservationSpecification right_side)
 {
     this.left_side = left_side;
     this.right_side = right_side;
 }
 public IConcern create_concern_from(Type type_with_concern, IObservationSpecification obseration_specification)
 {
     return(new Concern(type_with_concern.concern(),
                        type_with_concern.Name.as_bdd_style_name(),
                        type_with_concern.all_methods_that_meet(obseration_specification).as_observations()));
 }
 static public IEnumerable<MemberInfo> all_members_that_meet(this Type type, IObservationSpecification observation_specification)
 {
     var member_flags = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
     return type.GetMembers(member_flags).Where(observation_specification.is_satisfied_by);
 }