예제 #1
0
        public InteractiveHostTests()
        {
            _host = new InteractiveHost(typeof(CSharpReplServiceProvider), GetInteractiveHostPath(), ".", millisecondsTimeout: -1);

            RedirectOutput();

            _host.ResetAsync(new InteractiveHostOptions(initializationFile: null, culture: CultureInfo.InvariantCulture)).Wait();

            var remoteService = _host.TryGetService();
            Assert.NotNull(remoteService);

            _host.SetPathsAsync(new[] { s_fxDir }, new[] { s_homeDir }, s_homeDir).Wait();

            // assert and remove logo:
            var output = SplitLines(ReadOutputToEnd());
            var errorOutput = ReadErrorOutputToEnd();

            Assert.Equal("", errorOutput);
            Assert.Equal(2, output.Length);
            Assert.Equal("Microsoft (R) Roslyn C# Compiler version " + FileVersionInfo.GetVersionInfo(_host.GetType().Assembly.Location).FileVersion, output[0]);
            // "Type "#help" for more information."
            Assert.Equal(FeaturesResources.TypeHelpForMoreInformation, output[1]);

            // remove logo:
            ClearOutput();
        }
예제 #2
0
        public InteractiveHostTests()
        {
            Host = new InteractiveHost(typeof(CSharpRepl), GetInteractiveHostPath(), ".", millisecondsTimeout: -1);

            RedirectOutput();

            Host.ResetAsync(InteractiveHostOptions.Default).Wait();

            var remoteService = Host.TryGetService();
            Assert.NotNull(remoteService);

            remoteService.SetTestObjectFormattingOptions();

            // assert and remove logo:
            var output = ReadOutputToEnd().Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            var errorOutput = ReadErrorOutputToEnd();

            Assert.Equal("", errorOutput);
            Assert.Equal(2, output.Length);
            Assert.Equal("Microsoft (R) Roslyn C# Compiler version " + FileVersionInfo.GetVersionInfo(Host.GetType().Assembly.Location).FileVersion, output[0]);
            // "Type "#help" for more information."
            Assert.Equal(FeaturesResources.TypeHelpForMoreInformation, output[1]);

            // remove logo:
            ClearOutput();
        }
예제 #3
0
        public InteractiveHostTests()
        {
            Host = new InteractiveHost(typeof(CSharpReplServiceProvider), GetInteractiveHostPath(), ".", millisecondsTimeout: -1);

            RedirectOutput();

            Host.ResetAsync(new InteractiveHostOptions(initializationFile: null, culture: CultureInfo.InvariantCulture)).Wait();

            var remoteService = Host.TryGetService();

            Assert.NotNull(remoteService);

            remoteService.SetTestObjectFormattingOptions();

            Host.SetPathsAsync(new[] { s_fxDir }, new[] { s_homeDir }, s_homeDir).Wait();

            // assert and remove logo:
            var output      = SplitLines(ReadOutputToEnd());
            var errorOutput = ReadErrorOutputToEnd();

            Assert.Equal("", errorOutput);
            Assert.Equal(2, output.Length);
            Assert.Equal("Microsoft (R) Roslyn C# Compiler version " + FileVersionInfo.GetVersionInfo(Host.GetType().Assembly.Location).FileVersion, output[0]);
            // "Type "#help" for more information."
            Assert.Equal(FeaturesResources.TypeHelpForMoreInformation, output[1]);

            // remove logo:
            ClearOutput();
        }
예제 #4
0
        public InteractiveHostTests()
        {
            Host = new InteractiveHost(typeof(CSharpRepl), GetInteractiveHostPath(), ".", millisecondsTimeout: -1);

            RedirectOutput();

            Host.ResetAsync(InteractiveHostOptions.Default).Wait();

            var remoteService = Host.TryGetService();

            Assert.NotNull(remoteService);

            remoteService.SetTestObjectFormattingOptions();

            // assert and remove logo:
            var output      = ReadOutputToEnd().Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
            var errorOutput = ReadErrorOutputToEnd();

            Assert.Equal("", errorOutput);
            Assert.Equal(2, output.Length);
            Assert.Equal("Microsoft (R) Roslyn C# Compiler version " + FileVersionInfo.GetVersionInfo(Host.GetType().Assembly.Location).FileVersion, output[0]);
            // "Type "#help" for more information."
            Assert.Equal(FeaturesResources.TypeHelpForMoreInformation, output[1]);

            // remove logo:
            ClearOutput();
        }
예제 #5
0
        public InteractiveHostTests()
        {
            _host = new InteractiveHost(typeof(CSharpReplServiceProvider), ".", millisecondsTimeout: -1);

            RedirectOutput();

            _host.ResetAsync(new InteractiveHostOptions(initializationFile: null, culture: CultureInfo.InvariantCulture)).Wait();

            var remoteService = _host.TryGetService();

            Assert.NotNull(remoteService);

            _host.SetPathsAsync(new[] { s_fxDir }, new[] { s_homeDir }, s_homeDir).Wait();

            // assert and remove logo:
            var output      = SplitLines(ReadOutputToEnd());
            var errorOutput = ReadErrorOutputToEnd();

            Assert.Equal("", errorOutput);
            Assert.Equal(2, output.Length);
            Assert.Equal(string.Format(CSharpInteractiveEditorResources.Microsoft_R_Roslyn_CSharp_Compiler_version_0, FileVersionInfo.GetVersionInfo(_host.GetType().Assembly.Location).FileVersion), output[0]);
            // "Type "#help" for more information."
            Assert.Equal(FeaturesResources.Type_Sharphelp_for_more_information, output[1]);

            // remove logo:
            ClearOutput();
        }