Пример #1
0
        public void ItShowsTheAspNetCertificateGenerationMessageWhenInvokingACommandAfterInternalReportInstallSuccessHasBeenInvoked()
        {
            var dotnetFirstTime = new DotNetFirstTime();

            var command = dotnetFirstTime.Setup(Log, _testAssetsManager);


            command.Execute("internal-reportinstallsuccess", "test").Should().Pass();

            command.Execute("new", "--debug:ephemeral-hive");
        }
Пример #2
0
        public void ItCreatesThePathDFileOnMacOSWhenInvokedFromNativeInstaller()
        {
            var dotnetFirstTime = new DotNetFirstTime();

            var command = dotnetFirstTime.Setup(Log, _testAssetsManager);

            var pathsd = Path.Combine(dotnetFirstTime.TestDirectory, "paths.d");

            command.Execute("internal-reportinstallsuccess", "test").Should().Pass();

            File.Exists(pathsd).Should().BeTrue();
            File.ReadAllText(pathsd).Should().Be(CliFolderPathCalculator.ToolsShimPathInUnix.PathWithTilde);
        }
Пример #3
0
        public void ItCreatesTheProfileFileOnLinuxWhenInvokedFromNativeInstaller()
        {
            var dotnetFirstTime = new DotNetFirstTime();

            var command = dotnetFirstTime.Setup(Log, _testAssetsManager);

            var profiled = Path.Combine(dotnetFirstTime.TestDirectory, "profile.d");

            command.Execute("internal-reportinstallsuccess", "test").Should().Pass();

            File.Exists(profiled).Should().BeTrue();
            File.ReadAllText(profiled).Should().Be(
                $"export PATH=\"$PATH:{CliFolderPathCalculator.ToolsShimPathInUnix.PathWithDollar}\"");
        }
Пример #4
0
        public void Init(ITestOutputHelper log, TestAssetsManager testAssets)
        {
            if (TestDirectory == null)
            {
                var dotnetFirstTime = new DotNetFirstTime();

                var command = dotnetFirstTime.Setup(log, testAssets, testName: "Dotnet_first_time_experience_tests");

                FirstDotnetNonVerbUseCommandResult = command.Execute("--info");
                FirstDotnetVerbUseCommandResult    = command.Execute("new", "--debug:ephemeral-hive");

                TestDirectory       = dotnetFirstTime.TestDirectory;
                NugetFallbackFolder = dotnetFirstTime.NugetFallbackFolder;
                DotDotnetFolder     = dotnetFirstTime.DotDotnetFolder;
            }
        }
Пример #5
0
        public void ItDoesNotCreateAFirstUseSentinelFileNorAnAspNetCertificateSentinelFileUnderTheDotDotNetFolderWhenInternalReportInstallSuccessIsInvoked()
        {
            var dotnetFirstTime = new DotNetFirstTime();

            var command = dotnetFirstTime.Setup(Log, _testAssetsManager);

            // Disable telemetry to prevent the creation of the .dotnet folder
            // for machineid and docker cache files
            command = command.WithEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "true");

            command.Execute("internal-reportinstallsuccess", "test").Should().Pass();

            var homeFolder = dotnetFirstTime.NugetFallbackFolder.Parent;

            homeFolder.Should().NotExist();
        }
Пример #6
0
        public void ItShowsTheTelemetryNoticeWhenInvokingACommandAfterInternalReportInstallSuccessHasBeenInvoked()
        {
            var dotnetFirstTime = new DotNetFirstTime();

            var command = dotnetFirstTime.Setup(Log, _testAssetsManager);

            command.Execute("internal-reportinstallsuccess", "test").Should().Pass();

            var result = command.Execute("new", "--debug:ephemeral-hive");

            var expectedVersion = GetDotnetVersion();

            result.StdOut
            .Should()
            .ContainVisuallySameFragment(string.Format(
                                             Configurer.LocalizableStrings.FirstTimeMessageWelcome,
                                             DotnetFirstTimeUseConfigurer.DeriveDotnetVersionFromProductVersion(expectedVersion),
                                             expectedVersion))
            .And.ContainVisuallySameFragment(Configurer.LocalizableStrings.FirstTimeMessageMoreInformation);
        }