Example #1
0
        public void VersionCommandDisplaysCorrectVersion()
        {
            CommandResult result = new DotnetCommand()
                    .ExecuteWithCapturedOutput("--version");

            result.Should().Pass();
            Regex.IsMatch(result.StdOut.Trim(), @"[0-9]{1}\.[0-9]{1}\.[0-9]{1}-[a-zA-Z0-9]+-[0-9]{6}$").Should()
                .BeTrue($"Unexpected dotnet sdk version - {result.StdOut}");

        }
        static GivenThatTheUserIsRunningDotNetForTheFirstTime()
        {
            var testDirectory = TestAssetsManager.CreateTestDirectory("Dotnet_first_time_experience_tests");
            var testNugetCache = Path.Combine(testDirectory.Path, "nuget_cache");

            var command = new DotnetCommand()
                .WithWorkingDirectory(testDirectory.Path);
            command.Environment["NUGET_PACKAGES"] = testNugetCache;
            command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = "";

            _firstDotnetNonVerbUseCommandResult = command.ExecuteWithCapturedOutput("--info");
            _firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new");

            _nugetCacheFolder = new DirectoryInfo(testNugetCache);
        }        
Example #3
0
        public void ItRunsKestrelPortableAfterPublish()
        {
            TestInstance instance = TestAssetsManager.CreateTestInstance(KestrelSampleBase)
                                                     .WithLockFiles();

            var url = NetworkHelper.GetLocalhostUrlWithFreePort();
            var args = $"{url} {Guid.NewGuid().ToString()}";
            var dotnetCommand = new DotnetCommand();
            var output = Publish(Path.Combine(instance.TestRoot, KestrelPortable), true);

            try
            {
                dotnetCommand.ExecuteAsync($"{output} {args}");
                NetworkHelper.IsServerUp(url).Should().BeTrue($"Unable to connect to kestrel server - {KestrelPortable} @ {url}");
                NetworkHelper.TestGetRequest(url, args);
            }
            finally
            {
                dotnetCommand.KillTree();
            }
        }