コード例 #1
0
        public void CodeElements_TwoNamespacesInProjectWithFirstPartsTheName_ReturnsOneParentNamespaceWithTwoChildNamespaces()
        {
            CreateCodeModel();
            helper.AddNamespaceCompletionEntryInNamespace(String.Empty, "First");
            helper.AddNamespaceCompletionEntriesInNamespace("First", "A", "B");
            helper.NoCompletionItemsInNamespace("First.A");
            helper.NoCompletionItemsInNamespace("First.B");

            CodeElements  codeElements  = codeModel.CodeElements;
            CodeNamespace codeNamespace = codeElements.FirstCodeNamespaceOrDefault();

            CodeElements  members              = codeNamespace.Members;
            CodeNamespace firstChildNamespace  = members.FirstCodeNamespaceOrDefault();
            CodeNamespace secondChildNamespace = members.LastCodeNamespaceOrDefault();

            Assert.AreEqual(1, codeElements.Count);
            Assert.AreEqual("First", codeNamespace.FullName);
            Assert.AreEqual(2, codeNamespace.Members.Count);
            Assert.AreEqual("A", firstChildNamespace.Name);
            Assert.AreEqual("B", secondChildNamespace.Name);
        }