Skip to content

Commit

Permalink
Merge pull request #13 from nunit/features
Browse files Browse the repository at this point in the history
Cleanup and add a few new feature examples
  • Loading branch information
rprouse authored Mar 8, 2018
2 parents 8b1f051 + bb6931c commit aca5514
Show file tree
Hide file tree
Showing 22 changed files with 674 additions and 938 deletions.
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Normalize line endings
* text=auto

# Prevent files from being exported
.gitattributes export-ignore
.gitignore export-ignore

# ReSharper DotSettings files are in Unix Format
*.DotSettings text eol=lf

# MonoDevelop on Linux uses CRLF for these files
*.sln text eol=crlf
packages/repositories.config text eol=crlf

# Allows checking out and developing in Windows
# while mounting and running tests in Linux
*.sh text eol=lf
build text eol=lf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ packages

tools
!tools/packages.config
.vs
.dotnet
22 changes: 22 additions & 0 deletions DataDrivenTests/DataDrivenTestFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using NUnit.Framework;

namespace DataDrivenTests
{
[TestFixture(10)]
[TestFixture(42)]
public class DataDrivenTestFixture
{
int _x;

public DataDrivenTestFixture(int x)
{
_x = x;
}

[Test]
public void TestArguments()
{
Assert.Pass($"X is {_x}");
}
}
}
66 changes: 66 additions & 0 deletions DataDrivenTests/DataDrivenTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FBBC6F15-E718-4080-832C-9D1F4B7A352A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DataDrivenTests</RootNamespace>
<AssemblyName>DataDriven.Tests</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataDrivenTestFixture.cs" />
<Compile Include="GenericTestFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props'))" />
</Target>
</Project>
15 changes: 15 additions & 0 deletions DataDrivenTests/GenericTestFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using NUnit.Framework;

namespace DataDrivenTests
{
[TestFixture(typeof(int))]
[TestFixture(typeof(string))]
public class GenericTestFixture<T>
{
[Test]
public void TestType()
{
Assert.Pass($"The generic test type is {typeof(T)}");
}
}
}
36 changes: 36 additions & 0 deletions DataDrivenTests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DataDrivenTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataDrivenTests")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fbbc6f15-e718-4080-832c-9d1f4b7a352a")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
5 changes: 5 additions & 0 deletions DataDrivenTests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.9.0" targetFramework="net47" />
<package id="NUnit3TestAdapter" version="3.9.0" targetFramework="net47" />
</packages>
13 changes: 7 additions & 6 deletions ExpectedExceptionExample/ExpectedExceptionExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<AssemblyKeyContainerName />
<AssemblyName>ExpectedExceptionExample</AssemblyName>
<AssemblyName>ExpectedExceptionExample.Tests</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
Expand Down Expand Up @@ -70,13 +70,11 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.7.1\lib\net20\nunit.framework.dll</HintPath>
<Private>True</Private>
<Reference Include="nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.9.0\lib\net20\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="NUnit.System.Linq, Version=0.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.7.1\lib\net20\NUnit.System.Linq.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NUnit.3.9.0\lib\net20\NUnit.System.Linq.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
Expand Down Expand Up @@ -113,6 +111,9 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent />
Expand Down
2 changes: 1 addition & 1 deletion ExpectedExceptionExample/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.7.1" targetFramework="net20" />
<package id="NUnit" version="3.9.0" targetFramework="net20" />
</packages>
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 The NUnit Project
Copyright (c) 2018 Rob Prouse, Charlie Poole

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 55 additions & 0 deletions Samples.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Money", "money\Money.csproj", "{11EDF872-A04D-4F75-A1BF-71168DC86AF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExpectedExceptionExample", "ExpectedExceptionExample\ExpectedExceptionExample.csproj", "{A6E1D464-9AAF-4CA9-A818-819739132281}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssertSyntax", "syntax\AssertSyntax.csproj", "{06F46FA2-687B-4B46-A912-C1B0B4CC1B20}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{51996B31-851B-463C-8B57-A7E51CA034EC}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
build.cake = build.cake
BUILDING.md = BUILDING.md
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataDrivenTests", "DataDrivenTests\DataDrivenTests.csproj", "{FBBC6F15-E718-4080-832C-9D1F4B7A352A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{11EDF872-A04D-4F75-A1BF-71168DC86AF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11EDF872-A04D-4F75-A1BF-71168DC86AF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11EDF872-A04D-4F75-A1BF-71168DC86AF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11EDF872-A04D-4F75-A1BF-71168DC86AF3}.Release|Any CPU.Build.0 = Release|Any CPU
{A6E1D464-9AAF-4CA9-A818-819739132281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6E1D464-9AAF-4CA9-A818-819739132281}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6E1D464-9AAF-4CA9-A818-819739132281}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6E1D464-9AAF-4CA9-A818-819739132281}.Release|Any CPU.Build.0 = Release|Any CPU
{06F46FA2-687B-4B46-A912-C1B0B4CC1B20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06F46FA2-687B-4B46-A912-C1B0B4CC1B20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06F46FA2-687B-4B46-A912-C1B0B4CC1B20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06F46FA2-687B-4B46-A912-C1B0B4CC1B20}.Release|Any CPU.Build.0 = Release|Any CPU
{FBBC6F15-E718-4080-832C-9D1F4B7A352A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBBC6F15-E718-4080-832C-9D1F4B7A352A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBBC6F15-E718-4080-832C-9D1F4B7A352A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBBC6F15-E718-4080-832C-9D1F4B7A352A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {381F12E7-0FE3-4A81-8427-2BA14C454821}
EndGlobalSection
EndGlobal
Loading

0 comments on commit aca5514

Please sign in to comment.