diff --git a/src/Microsoft.DotNet.Configurer/DotnetFirstRunConfiguration.cs b/src/Microsoft.DotNet.Configurer/DotnetFirstRunConfiguration.cs index 955337e6e..b959c7c41 100644 --- a/src/Microsoft.DotNet.Configurer/DotnetFirstRunConfiguration.cs +++ b/src/Microsoft.DotNet.Configurer/DotnetFirstRunConfiguration.cs @@ -5,10 +5,20 @@ namespace Microsoft.DotNet.Configurer { public class DotnetFirstRunConfiguration { - public bool GenerateAspNetCertificate { get; set; } + public bool GenerateAspNetCertificate { get; } - public bool PrintTelemetryMessage { get; set; } + public bool PrintTelemetryMessage { get; } - public bool SkipFirstRunExperience { get; set; } + public bool SkipFirstRunExperience { get; } + + public DotnetFirstRunConfiguration( + bool generateAspNetCertificate, + bool printTelemetryMessage, + bool skipFirstRunExperience) + { + GenerateAspNetCertificate = generateAspNetCertificate; + PrintTelemetryMessage = printTelemetryMessage; + SkipFirstRunExperience = skipFirstRunExperience; + } } } \ No newline at end of file diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs index 1d8d94b90..95daf8b7e 100644 --- a/src/dotnet/Program.cs +++ b/src/dotnet/Program.cs @@ -164,12 +164,10 @@ namespace Microsoft.DotNet.Cli skipFirstRunExperience = false; } - var dotnetFirstRunConfiguration = new DotnetFirstRunConfiguration - { - GenerateAspNetCertificate = generateAspNetCertificate, - PrintTelemetryMessage = printTelemetryMessage, - SkipFirstRunExperience = skipFirstRunExperience - }; + var dotnetFirstRunConfiguration = new DotnetFirstRunConfiguration( + generateAspNetCertificate, + printTelemetryMessage, + skipFirstRunExperience); ConfigureDotNetForFirstTimeUse( nugetCacheSentinel, diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs index cc5ac83e7..37036602d 100644 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs +++ b/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs @@ -49,10 +49,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -76,10 +77,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = true, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: true + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -103,10 +105,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = false - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: false, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -130,10 +133,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -157,10 +161,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -183,10 +188,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -209,10 +215,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -235,10 +242,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = true, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: true + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -261,10 +269,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -288,10 +297,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -318,10 +328,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -349,10 +360,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -376,11 +388,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true, - GenerateAspNetCertificate = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -404,10 +416,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -438,10 +451,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -464,10 +478,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -491,10 +506,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: true + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -518,10 +534,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true - }, + ( + generateAspNetCertificate: false, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -545,11 +562,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true, - GenerateAspNetCertificate = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -573,11 +590,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = false, - PrintTelemetryMessage = true, - GenerateAspNetCertificate = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: false + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object); @@ -598,11 +615,11 @@ namespace Microsoft.DotNet.Configurer.UnitTests _aspNetCoreCertificateGeneratorMock.Object, _toolPathSentinelMock.Object, new DotnetFirstRunConfiguration - { - SkipFirstRunExperience = true, - PrintTelemetryMessage = true, - GenerateAspNetCertificate = true - }, + ( + generateAspNetCertificate: true, + printTelemetryMessage: true, + skipFirstRunExperience: true + ), _reporterMock.Object, CliFallbackFolderPath, _pathAdderMock.Object);