<commit_before>﻿// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
using FluentAssertions;
using Microsoft.DotNet.Cli.Utils;

namespace Microsoft.DotNet.New.Tests
{
    public class GivenThatIWantANewAppWithSpecifiedType : TestBase
    {
        [Theory]
        [InlineData("C#", "console", false, false)]
        [InlineData("C#", "classlib", false, false)]
        [InlineData("C#", "mstest", false, false)]
        [InlineData("C#", "xunit", false, false)]
        [InlineData("C#", "web", false, false)]
        [InlineData("C#", "mvc", false, false)]
        [InlineData("C#", "webapi", false, false)]
        [InlineData("C#", "angular", false, true)]
        [InlineData("C#", "react", false, true)]
        [InlineData("C#", "reactredux", false, true)]
        [InlineData("F#", "console", false, false)]
        [InlineData("F#", "classlib", false, false)]
        [InlineData("F#", "mstest", false, false)]
        [InlineData("F#", "xunit", false, false)]
        [InlineData("F#", "mvc", true, false)]
        public void TemplateRestoresAndBuildsWithoutWarnings(
            string language,
            string projectType,
            bool useNuGetConfigForAspNet,
            bool skipSpaWebpackSteps)
        {
            if (language == "F#" && !EnvironmentInfo.HasSharedFramework("netcoreapp1.0"))
            {
                // F# requires netcoreapp1.0 to be present in order to build
                // https://github.com/dotnet/netcorecli-fsc/issues/76
                return;
            }

            string rootPath = TestAssets.CreateTestDirectory(identifier: $"{language}_{projectType}").FullName;

            new TestCommand("dotnet") { WorkingDirectory = rootPath }
                .Execute($"new {projectType} -lang {language} -o {rootPath} --debug:ephemeral-hive --no-restore")
                .Should().Pass();

            if (useNuGetConfigForAspNet)
            {
                var configFile = new FileInfo(Path.Combine(rootPath, "..", "..", "..", "..", "..", "NuGet.tempaspnetpatch.config"));
                File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config"));
            }<commit_msg>reenable smoke test of F# templates<commit_after>﻿// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
using FluentAssertions;
using Microsoft.DotNet.Cli.Utils;

namespace Microsoft.DotNet.New.Tests
{
    public class GivenThatIWantANewAppWithSpecifiedType : TestBase
    {
        [Theory]
        [InlineData("C#", "console", false, false)]
        [InlineData("C#", "classlib", false, false)]
        [InlineData("C#", "mstest", false, false)]
        [InlineData("C#", "xunit", false, false)]
        [InlineData("C#", "web", false, false)]
        [InlineData("C#", "mvc", false, false)]
        [InlineData("C#", "webapi", false, false)]
        [InlineData("C#", "angular", false, true)]
        [InlineData("C#", "react", false, true)]
        [InlineData("C#", "reactredux", false, true)]
        [InlineData("F#", "console", false, false)]
        [InlineData("F#", "classlib", false, false)]
        [InlineData("F#", "mstest", false, false)]
        [InlineData("F#", "xunit", false, false)]
        [InlineData("F#", "mvc", true, false)]
        public void TemplateRestoresAndBuildsWithoutWarnings(
            string language,
            string projectType,
            bool useNuGetConfigForAspNet,
            bool skipSpaWebpackSteps)
        {
            string rootPath = TestAssets.CreateTestDirectory(identifier: $"{language}_{projectType}").FullName;

            new TestCommand("dotnet") { WorkingDirectory = rootPath }
                .Execute($"new {projectType} -lang {language} -o {rootPath} --debug:ephemeral-hive --no-restore")
                .Should().Pass();

            if (useNuGetConfigForAspNet)
            {
                var configFile = new FileInfo(Path.Combine(rootPath, "..", "..", "..", "..", "..", "NuGet.tempaspnetpatch.config"));
                File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config"));
            }
{'fraction_non_alphanumeric': 0.15144334338647134, 'fraction_numerical': 0.0012925463162429987, 'mean_word_length': 2.793300653594771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '257011', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1371, 'n_words': 319}