예제 #1
0
        public void Members_ProjectHasTwoNamespacesWithCommonFirstAndSecondPartOfThreePartNamespace_ReturnsOneChildNamespaceWhichHasOneChildNamespace()
        {
            CreateProjectContent();
            helper.AddNamespaceCompletionEntryInNamespace("First", "Second");
            helper.AddNamespaceCompletionEntriesInNamespace("First.Second", "Third", "Different");
            CreateCodeNamespace("First");

            CodeElements  members         = codeNamespace.Members;
            CodeNamespace secondNamespace = members.FirstOrDefault() as CodeNamespace;

            Assert.AreEqual("First", codeNamespace.Name);
            Assert.AreEqual(1, members.Count);
            Assert.AreEqual("Second", secondNamespace.Name);
            Assert.AreEqual("First.Second", secondNamespace.FullName);
            Assert.AreEqual(2, secondNamespace.Members.Count);
        }
 public static CodeImport FirstCodeImportOrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeImport);
 }
 public static CodeParameter FirstCodeParameterOrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeParameter);
 }
 public static CodeVariable FirstCodeVariableOrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeVariable);
 }
 public static CodeProperty2 FirstCodeProperty2OrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeProperty2);
 }
 public static CodeAttribute2 FirstCodeAttribute2OrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeAttribute2);
 }
 public static CodeNamespace FirstCodeNamespaceOrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeNamespace);
 }
 public static CodeClass2 FirstCodeClass2OrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeClass2);
 }
 public static CodeFunction FirstCodeFunctionOrDefault(this CodeElements codeElements)
 {
     return(codeElements.FirstOrDefault() as CodeFunction);
 }