Added tests as a project to the solution

This commit is contained in:
jplebre 2016-07-30 00:14:56 +01:00
parent 82bf84f46b
commit 06d7a84c08
4 changed files with 92 additions and 23 deletions

View file

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
EndProject
@ -121,6 +121,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Configurer
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Archive", "src\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.xproj", "{35B19F22-B8C0-4849-9C35-3F809B7588B8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-new.Tests", "test\dotnet-new.Tests\dotnet-new.Tests.xproj", "{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -805,22 +807,6 @@ Global
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Debug|x64.ActiveCfg = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Debug|x64.Build.0 = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Release|Any CPU.Build.0 = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Release|x64.ActiveCfg = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.Release|x64.Build.0 = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{1DBB7542-0345-4F4B-A84B-3B00B185D416}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{1C599FFD-FB52-4279-A8E5-465D3EC499E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C599FFD-FB52-4279-A8E5-465D3EC499E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C599FFD-FB52-4279-A8E5-465D3EC499E1}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -901,6 +887,22 @@ Global
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{35B19F22-B8C0-4849-9C35-3F809B7588B8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Debug|x64.ActiveCfg = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Debug|x64.Build.0 = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Release|Any CPU.Build.0 = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Release|x64.ActiveCfg = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.Release|x64.Build.0 = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -953,11 +955,11 @@ Global
{49BEB486-AB5A-4416-91EA-8CD34ABB0C9D} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
{B768BD29-12BF-4C7C-B093-03193FE244D1} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
{A28BD8AC-DF15-4F58-8299-98A9AE2B8726} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
{1DBB7542-0345-4F4B-A84B-3B00B185D416} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3}
{1C599FFD-FB52-4279-A8E5-465D3EC499E1} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{5DF6C9DA-6909-4EC0-909E-6913580BB4A4} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{E5ED47EF-BF25-4DA9-A7FE-290C642CBF0F} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{35B19F22-B8C0-4849-9C35-3F809B7588B8} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{712A4AFF-D758-49B0-AB46-B6DD2FFC9D26} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,51 @@
// 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.IO;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
using FluentAssertions;
namespace Microsoft.DotNet.Tests
{
public class GivenThatIWantANewCSnUnitProject : TestBase
{
[Fact]
public void When_nUnit_project_created_Then_project_restores()
{
var rootPath = Temp.CreateDirectory().Path;
var projectJsonFile = Path.Combine(rootPath, "project.json");
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("new --type nunittest")
.Should()
.Pass();
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("restore")
.Should().Pass();
}
[Fact]
public void When_dotnet_test_is_invoked_Then_tests_run_without_errors()
{
var rootPath = Temp.CreateDirectory().Path;
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("new --type nunittest");
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("restore");
var buildResult = new TestCommand("dotnet")
.WithWorkingDirectory(rootPath)
.ExecuteWithCapturedOutput("test")
.Should()
.Pass()
.And
.NotHaveStdErr();
}
}
}

View file

@ -1,13 +1,8 @@
// 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.Linq;
using Microsoft.DotNet.Tools.Test.Utilities;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
using FluentAssertions;

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>712a4aff-d758-49b0-ab46-b6dd2ffc9d26</ProjectGuid>
<RootNamespace>dotnet-new.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>