Beispiel #1
0
    protected MemberAutoDataImprovedAttribute(string memberName, object[] parameters, Func <IFixture> fixtureFactory)
    {
        if (fixtureFactory == null)
        {
            throw new ArgumentNullException(nameof(fixtureFactory));
        }

        memberDataAttribute = new MemberDataAttribute(memberName, parameters);
        fixture             = new Lazy <IFixture>(fixtureFactory, LazyThreadSafetyMode.PublicationOnly);
    }
 public void CannotFindMemberDataAttribute_DoesNotGetStuck(string methodName)
 {
     try
     {
         MemberDataAttribute.GetData(typeof(NotATestClass).GetMethod(methodName));
     }
     catch (ArgumentException ex)
     {
         Assert.IsTrue(ex.Message.Contains("Cannot locate a field, property"));
     }
 }
Beispiel #3
0
        public void MultiMemberDataAttribute_matches_PropertyDataAttribute_for_single_data_source( )
        {
            var method = IntMethod(default(int));

            var memberDataAttribute      = new MemberDataAttribute(IntsName);
            var multiMemberDataAttribute = new MultiMemberDataAttribute(IntsName);

            object[][] propertyData    = memberDataAttribute.GetData(method).ToArray( );
            object[][] multiMemberData = multiMemberDataAttribute.GetData(method).ToArray( );

            Assert.Equal(propertyData, multiMemberData, Comparer);
        }
 public PerCompilationTypeAttribute(string memberName, params object[] parameters)
 {
     delegatedTo = new MemberDataAttribute(memberName, parameters);
 }