Exemplo n.º 1
0
 public void XmlSchemaExporter()
 {
     var namespaceManager = new XmlNamespaceManager(new NameTable());
     namespaceManager.AddNamespace(NodaTimeXmlNamespace.Name, NodaTimeXmlNamespace.Namespace);
     var xmlSchema = GetXmlSchema<NodaTimeObject>();
     var xml = GetXmlSchemaString(xmlSchema, namespaceManager);
     Approvals.VerifyWithExtension(xml, "xml");
 }
Exemplo n.º 2
0
        public void ListAllVerifyFunctions()
        {
            var allClasses  = typeof(Approvals).Assembly.GetTypes();
            var classes     = allClasses.Where(c => !c.GetCustomAttributes(false).Any(a => a.GetType().Name.Contains("Obsolete")));
            var methodInfos = classes.SelectMany(t => t.GetMethods());

            var verifys        = methodInfos.Where(m => m.Name.StartsWith("Verify"));
            var duplicateNames = new HashSet <string>();
            var unique         = verifys.Where(v =>
            {
                var n   = $"{v.DeclaringType.Name}.{v.Name}";
                var dup = !duplicateNames.Contains(n);
                duplicateNames.Add(n);
                return(dup);
            });
            var linkText = unique.Select(v => $"{v.DeclaringType.Name}.[{v.Name}]({GetLink(v)})({ShowParameters(v.GetParameters())})").JoinWith("  \n  \n");

            Approvals.VerifyWithExtension(linkText, ".include.md");
        }
Exemplo n.º 3
0
 public void XmlSchema()
 {
     var xml = GetXmlSchemaString(NodaTimeXmlSchema);
     Approvals.VerifyWithExtension(xml, "xml");
 }
 public void VerifyWithExtension()
 {
     Approvals.VerifyWithExtension("should,be,approved", ".csv");
 }