Exemple #1
0
        public void SuggestMissingUsingsForNestedType()
        {
            SimpleCodeCompletion.ResetProject();

            var info = SimpleCodeCompletion.GetPossibleNamespaces(code, "SubTest", "test.cs").FirstOrDefault();

            Assert.Equal("NSTest", info.Namespace);
            Assert.Equal("NSTest.TopTest.SubTest", info.FullName);
        }
Exemple #2
0
        public void SuggestMissingUsingsForTopLevelType()
        {
            SimpleCodeCompletion.ResetProject();

            var info = SimpleCodeCompletion.GetPossibleNamespaces(code, "File", "test.cs").ToArray();

            Assert.Equal("System.IO", info[0].Namespace);
            Assert.Equal("System.IO.File", info[0].FullName);

            Assert.Equal("System.Net", info[1].Namespace);
            Assert.Equal("System.Net.WebRequestMethods.File", info[1].FullName);

            Assert.False(info[0].IsNested);
            Assert.True(info[1].IsNested);
        }