This is a cache of metadata about a specific property.
 public void PropertyMetadataCollection_CopyTo_Test3()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Tests.Metadata.Mock)).Properties;
         var array = new PropertyMetadata[result.Count];
         result.CopyTo(array, 0);
         foreach (var p in result)
             CollectionAssert.Contains(array, p);
     }
 }
        public void PropertyMetadataCollection_CopyTo_Test2()
        {
            using (var verify = new Verify())
            {
                try
                {
                    var result = MetadataCache.GetMetadata(typeof(Tests.Metadata.Mock)).Properties;
                    var array = new PropertyMetadata[0];
                    result.CopyTo(array, 0);

                    verify.Fail("Expected an ArgumentNullException");
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    verify.AreEqual("arrayIndex", ex.ParamName, "Incorrect parameter name");
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds a property to the list of calculated values watching this property.
 /// </summary>
 /// <param name="affectedProperty"></param>
 internal void AddCalculatedField(PropertyMetadata affectedProperty)
 {
     m_CalculatedFieldsBuilder.Add(affectedProperty);
 }