private void AddName(IDocumentName windowName)
 {
     if (windowName != null)
     {
         AllDocumentNames.Add(windowName.Identifier);
     }
 }
 private static bool NameEndsWithTest(this IDocumentName document)
 {
     var filename = document.FileName;
     if (filename != null)
     {
         return filename.Contains("test", CompareOptions.IgnoreCase);
     }
     return false;
 }
        public static DocumentType GuessDocumentType(IDocumentName docName, ISST context)
        {
            if (docName.Language != "CSharp")
            {
                return(DocumentType.Undefined);
            }

            var finder       = new NamespaceFinderVisitor(TestNamespaces);
            var testWasFound = new ValueTypeWrapper <bool>(false);

            finder.Visit(context, testWasFound);

            if (testWasFound)
            {
                return(DocumentType.Test);
            }

            finder = new NamespaceFinderVisitor(TestFrameworkNamespaces);
            var testFrameworkWasFound = new ValueTypeWrapper <bool>(false);

            finder.Visit(context, testFrameworkWasFound);

            if (testFrameworkWasFound)
            {
                return(DocumentType.TestFramework);
            }

            if (Path.GetFileNameWithoutExtension(docName.FileName).Contains("test", CompareOptions.IgnoreCase))
            {
                return(DocumentType.FilenameTest);
            }

            if (docName.FileName.Contains("test", CompareOptions.IgnoreCase))
            {
                return(DocumentType.PathnameTest);
            }

            return(DocumentType.Production);
        }
 public static bool IsTestDocument(this IDocumentName document)
 {
     return NameEndsWithTest(document);
 }
 public static bool IsProductionDocument(this IDocumentName document)
 {
     return !IsTestDocument(document);
 }
 public static IDocumentName ToAnonymousName([CanBeNull] this IDocumentName document)
 {
     return(document == null
         ? null
         : Names.Document("{0} {1}", document.Language, document.FileName.HashIfFile()));
 }