public async Task ReturnsEmptyResponseForEmptyWorskpace()
        {
            var workspace = await TestHelpers.CreateSimpleWorkspace(new Dictionary<string, string>());
            var controller = new GotoFileService(workspace);
            var response = await controller.Handle(new GotoFileRequest());

            Assert.Equal(0, response.QuickFixes.Count());
        }
Example #2
0
        public async Task ReturnsEmptyResponseForEmptyWorskpace()
        {
            var workspace = await TestHelpers.CreateSimpleWorkspace(new Dictionary <string, string>());

            var controller = new GotoFileService(workspace);
            var response   = await controller.Handle(new GotoFileRequest());

            Assert.Equal(0, response.QuickFixes.Count());
        }
        public async Task ReturnsAListOfAllWorkspaceFiles()
        {
            var source1 = @"class Foo {}";
            var source2 = @"class Bar {}";

            var workspace = await TestHelpers.CreateSimpleWorkspace(new Dictionary<string, string> {
                { "foo.cs", source1 }, { "bar.cs", source2}
            });
            var controller = new GotoFileService(workspace);
            var response = await controller.Handle(new GotoFileRequest());

            Assert.Equal(2, response.QuickFixes.Count());
            Assert.Equal("foo.cs", response.QuickFixes.ElementAt(0).FileName);
            Assert.Equal("bar.cs", response.QuickFixes.ElementAt(1).FileName);
        }
Example #4
0
        public async Task ReturnsAListOfAllWorkspaceFiles()
        {
            var source1 = @"class Foo {}";
            var source2 = @"class Bar {}";

            var workspace = await TestHelpers.CreateSimpleWorkspace(new Dictionary <string, string> {
                { "foo.cs", source1 }, { "bar.cs", source2 }
            });

            var controller = new GotoFileService(workspace);
            var response   = await controller.Handle(new GotoFileRequest());

            Assert.Equal(2, response.QuickFixes.Count());
            Assert.Equal("foo.cs", response.QuickFixes.ElementAt(0).FileName);
            Assert.Equal("bar.cs", response.QuickFixes.ElementAt(1).FileName);
        }