Exemplo n.º 1
0
        public async Task FormatRespectsIndentationSize()
        {
            var source = "namespace Bar\n{\n    class Foo {}\n}";

            var workspace  = TestHelpers.CreateSimpleWorkspace(source);
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions
            {
                Options = new OmniSharpOptions
                {
                    FormattingOptions = new FormattingOptions
                    {
                        NewLine         = "\n",
                        IndentationSize = 1
                    }
                }
            });

            var result = await controller.FormatDocument(new Request
            {
                FileName = "dummy.cs"
            });

            Assert.Equal("namespace Bar\n{\n class Foo { }\n}", result.Buffer);
        }
Exemplo n.º 2
0
        public async Task FormatRespectsIndentationSize()
        {
            var source = "namespace Bar\n{\n    class Foo {}\n}";

            var workspace = TestHelpers.CreateSimpleWorkspace(source);
            var controller = new OmnisharpController(workspace, new FakeOmniSharpOptions
            {
                Options = new OmniSharpOptions
                {
                    FormattingOptions = new FormattingOptions
                    {
                        NewLine = "\n",
                        IndentationSize = 1
                    }
                }
            });

            var result = await controller.FormatDocument(new Request
            {
                FileName = "dummy.cs"
            });

            Assert.Equal("namespace Bar\n{\n class Foo { }\n}", result.Buffer);
        }