Beispiel #1
0
        public void MultiMemberDataAttribute_succeeds_for_data_sources_with_multple_values( )
        {
            var method       = DoubleDoubleMethod(default(double), default(double));
            var attribute    = new MultiMemberDataAttribute(MultiDoublesName);
            var propertyData = multiDoubles_;

            var attributeData = attribute.GetData(method).ToArray( );

            Assert.Equal(propertyData, attributeData, Comparer);
        }
Beispiel #2
0
        public void MultiMemberDataAttribute_succeeds_for_multiple_data_sources_with_multple_values( )
        {
            var method          = IntDoubleDoubleMethod(default(int), default(double), default(double));
            var attribute       = new MultiMemberDataAttribute(IntsName, MultiDoublesName);
            var rawPropertyData = new[] { Ints.ToArray( ), multiDoubles_ };
            var propertyData    = GetFlattenedPermutations(rawPropertyData);

            var attributeData = attribute.GetData(method).ToArray( );

            Assert.Equal(propertyData, attributeData, Comparer);
        }
Beispiel #3
0
        public void MultiMemberDataAttribute_succeeds_for_multiple_data_sources( )
        {
            var method          = IntCharMethod(default(int), default(char));
            var attribute       = new MultiMemberDataAttribute(IntsName, CharsName);
            var rawPropertyData = new[] { ToObjectArray(ints_), ToObjectArray(chars_) };
            var propertyData    = Permuter.Permute(rawPropertyData);

            var attributeData = attribute.GetData(method).ToArray( );

            Assert.Equal(propertyData, attributeData, Comparer);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public void MultiMemberDataAttribute_succeeds_for_data_sources_of_mutable_values( )
        {
            var method    = MutableMutableMethod(default(Mutable), default(Mutable));
            var attribute = new MultiMemberDataAttribute(OneMutableName, TwoMutablesName);

            var attributeData = attribute.GetData(method).ToArray( );

            foreach (object[] data in attributeData)
            {
                foreach (object item in data)
                {
                    var mutable = Assert.IsType <Mutable>(item);
                    Assert.False(mutable.IsMutated);
                    mutable.IsMutated = true;
                }
            }
        }