private static void CompareNewWay(NameAndType expectedField, PropertyInfo propertyInfo)
        {
            var foundAttributes = CustomAttributeData.GetCustomAttributes(propertyInfo)
                                  .AsQueryable().OrderBy(a => a.ToString()).ToList();

            Assert.AreEqual(expectedField.ParameterAttributes.Count, foundAttributes.Count(), "For Field: " + propertyInfo.Name);
            if (foundAttributes.Count() > 0)
            {
                for (int j = 0; j < foundAttributes.Count(); j++)
                {
                    //Assert.AreEqual(expectedField.Attributes[j], foundAttributes[j].ToString(), "For Field: " + propertyInfo.Name);
                    Assert.IsTrue(
                        foundAttributes[j].ToString().StartsWith(
                            expectedField.ParameterAttributes[j].AttributeNameStartsWith));
                    var namedParameters = foundAttributes[j].NamedArguments.ToList();
                    Assert.AreEqual(expectedField.ParameterAttributes[j].NamedParameters.Count, namedParameters.Count,
                                    "For Field: " + propertyInfo.Name + " For Attribute: " + foundAttributes[j]);
                    if (namedParameters.Count > 0)
                    {
                        var namedParametersAsStrings = new List <string>();
                        foreach (var namedParameter in namedParameters)
                        {
                            namedParametersAsStrings.Add(namedParameter.ToString());
                        }
                        foreach (var expectedParameter in expectedField.ParameterAttributes[j].NamedParameters)
                        {
                            Assert.IsTrue(namedParametersAsStrings.Contains(expectedParameter), "For Field: " + propertyInfo.Name + " For Attribute: " + foundAttributes[j] + "Expected Parameter: " + expectedParameter + " Found: " + namedParametersAsStrings.ParseList());
                        }
                    }
                }
            }
        }
        private static void CompareOldWay(NameAndType expectedField, PropertyInfo propertyInfo)
        {
            var foundAttributes = CustomAttributeData.GetCustomAttributes(propertyInfo)
                                  .AsQueryable().OrderBy(a => a.ToString()).ToList();

            Assert.AreEqual(expectedField.Attributes.Count, foundAttributes.Count(), "For Field: " + propertyInfo.Name);
            if (foundAttributes.Count() > 0)
            {
                for (int j = 0; j < foundAttributes.Count(); j++)
                {
                    Assert.AreEqual(expectedField.Attributes[j], foundAttributes[j].ToString(), "For Field: " + propertyInfo.Name);
                }
            }
        }