public void Members_ProjectHasTwoNamespacesWithCommonFirstAndSecondPartOfThreePartNamespace_ReturnsOneChildNamespaceWhichHasOneChildNamespace() { CreateProjectContent(); helper.AddNamespaceCompletionEntryInNamespace("First", "Second"); helper.AddNamespaceCompletionEntriesInNamespace("First.Second", "Third", "Different"); CreateCodeNamespace("First"); global::EnvDTE.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 void Members_ProjectHasTwoNamespacesWithCommonFirstAndSecondPartOfThreePartNamespace_ReturnsOneChildNamespaceWhichHasOneChildNamespace() { string code = "namespace First.Second {\r\n" + " namespace Third {}\r\n" + " namespace Different {}\r\n" + "}"; CreateCodeNamespace(code, "First"); global::EnvDTE.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 global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeImport); }
public static CodeParameter2 FirstCodeParameter2OrDefault(this global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeParameter2); }
public static CodeVariable FirstCodeVariableOrDefault(this global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeVariable); }
public static CodeProperty2 FirstCodeProperty2OrDefault(this global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeProperty2); }
public static CodeAttribute2 FirstCodeAttribute2OrDefault(this global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeAttribute2); }
public static CodeNamespace FirstCodeNamespaceOrDefault(this global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeNamespace); }
public static CodeFunction2 FirstCodeFunction2OrDefault(this global::EnvDTE.CodeElements codeElements) { return(codeElements.FirstOrDefault() as CodeFunction2); }