<commit_before>using System.Threading.Tasks;
using OmniSharp.Models;
using Xunit;

namespace OmniSharp.Tests 
{
    public class TypeLookupFacts
    {
        [Fact]
        public async Task OmitsNamespaceForNonRegularCSharpSyntax()
        {
            var source1 = @"class Foo {}";
            
            var workspace = TestHelpers.CreateCsxWorkspace(source1);
            
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var response = await controller.TypeLookup(new TypeLookupRequest { FileName = "dummy.csx", Line = 1, Column = 8 });
            
            Assert.Equal("Foo", response.Type);   
        } 
        
        [Fact]
        public async Task IncludesNamespaceForRegularCSharpSyntax()
        {
            var source1 = @"namespace Bar {
            class Foo {}
            }";
            
            var workspace = TestHelpers.CreateSimpleWorkspace(source1);
            
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var response = await controller.TypeLookup(new TypeLookupRequest { FileName = "dummy.cs", Line = 2, Column = 20 });
            
            Assert.Equal("Bar.Foo", response.Type);   
        } 
    }
}<commit_msg>added test for global namespace<commit_after>using System.Threading.Tasks;
using OmniSharp.Models;
using Xunit;

namespace OmniSharp.Tests 
{
    public class TypeLookupFacts
    {
        [Fact]
        public async Task OmitsNamespaceForNonRegularCSharpSyntax()
        {
            var source1 = @"class Foo {}";
            
            var workspace = TestHelpers.CreateCsxWorkspace(source1);
            
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var response = await controller.TypeLookup(new TypeLookupRequest { FileName = "dummy.csx", Line = 1, Column = 8 });
            
            Assert.Equal("Foo", response.Type);   
        }

        [Fact]
        public async Task OmitsNamespaceForTypesInGlobalNamespace()
        {
            var source = @"namespace Bar {
            class Foo {}
            }
            class Baz {}";

            var workspace = TestHelpers.CreateSimpleWorkspace(source);

            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var responseInNormalNamespace = await controller.TypeLookup(new TypeLookupRequest { FileName = "dummy.cs", Line = 2, Column = 20 });
            var responseInGlobalNamespace = await controller.TypeLookup(new TypeLookupRequest { FileName = "dummy.cs", Line = 4, Column = 20 });

            Assert.Equal("Bar.Foo", responseInNormalNamespace.Type);
            Assert.Equal("Baz", responseInGlobalNamespace.Type);
        }

        [Fact]
        public async Task IncludesNamespaceForRegularCSharpSyntax()
        {
            var source1 = @"namespace Bar {
            class Foo {}
            }";
            
            var workspace = TestHelpers.CreateSimpleWorkspace(source1);
            
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions());
            var response = await controller.TypeLookup(new TypeLookupRequest { FileName = "dummy.cs", Line = 2, Column = 20 });
            
            Assert.Equal("Bar.Foo", response.Type);   
        } 
    }
}
{'fraction_non_alphanumeric': 0.08942848682262364, 'fraction_numerical': 0.0071068996150429374, 'mean_word_length': 2.0625566636446058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4428038', 'n_tokens_mistral': 890, 'n_tokens_neox': 842, 'n_words': 202}