зеркало из
1
0
Форкнуть 0
This commit is contained in:
Terje Sandstrom 2014-04-06 00:55:53 +02:00
Родитель fcc67d7c7f ffbfcb6d94
Коммит 16282e06da
10 изменённых файлов: 71 добавлений и 15 удалений

5
.gitignore поставляемый
Просмотреть файл

@ -160,3 +160,8 @@ $RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
*.ldf
*.mdf
/Backup
/UpgradeLog.htm
packages/

Двоичные данные
NUnitTestAdapter.sln

Двоичный файл не отображается.

Просмотреть файл

@ -2,6 +2,9 @@
// Copyright (c) 2013 NUnit Software. All rights reserved.
// ****************************************************************
using System.Linq;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
namespace NUnit.VisualStudio.TestAdapter
{
using System;
@ -46,16 +49,14 @@ namespace NUnit.VisualStudio.TestAdapter
this.nunitFilter = MakeTestFilter(selectedTestCases);
}
private readonly ITfsTestFilter TfsFilter;
// This constructor is used when the executor is called with a list of assemblies
public AssemblyRunner(TestLogger logger, string assemblyName, TFSTestFilter tfsFilter)
public AssemblyRunner(TestLogger logger, string assemblyName, ITfsTestFilter tfsFilter)
: this(logger, assemblyName)
{
if (tfsFilter.HasTfsFilterValue)
{
var filteredTestCases = tfsFilter.CheckFilter(this.LoadedTestCases);
this.nunitFilter = MakeTestFilter(filteredTestCases);
TfsFilter = tfsFilter;
}
}
private static SimpleNameFilter MakeTestFilter(IEnumerable<TestCase> ptestCases)
{
@ -98,7 +99,7 @@ namespace NUnit.VisualStudio.TestAdapter
try
{
#if LAUNCHDEBUGGER
Debugger.Launch();
System.Diagnostics.Debugger.Launch();
#endif
if (TryLoadAssembly())
{
@ -156,9 +157,14 @@ namespace NUnit.VisualStudio.TestAdapter
if (!runner.Load(package))
return false;
logger.SendMessage(TestMessageLevel.Informational,string.Format("Loading tests from {0}",package.FullName));
AddTestCases(runner.Test);
if (TfsFilter==null || !TfsFilter.HasTfsFilterValue)
return true;
var filteredTestCases = TfsFilter.CheckFilter(this.LoadedTestCases);
var ptestCases = filteredTestCases as TestCase[] ?? filteredTestCases.ToArray();
logger.SendMessage(TestMessageLevel.Informational, string.Format("TFS Filter detected: LoadedTestCases {0}, Filterered Test Cases {1}", LoadedTestCases.Count, ptestCases.Count()));
this.nunitFilter = MakeTestFilter(ptestCases);
return true;
}

Просмотреть файл

@ -21,5 +21,5 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
[assembly: Guid("c0aad5e4-b486-49bc-b3e8-31e01be6fefe")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.7")]
[assembly: AssemblyFileVersion("1.0.0.7")]

Просмотреть файл

@ -14,7 +14,14 @@ namespace NUnit.VisualStudio.TestAdapter
{
using System.Collections;
public class TFSTestFilter
public interface ITfsTestFilter
{
ITestCaseFilterExpression TfsTestCaseFilterExpression { get; }
bool HasTfsFilterValue { get; }
IEnumerable<TestCase> CheckFilter(IEnumerable<TestCase> tests);
}
public class TFSTestFilter : ITfsTestFilter
{
/// <summary>
/// Supported properties for filtering

Двоичные данные
src/NUnitTestAdapterInstall/license.rtf

Двоичный файл не отображается.

Просмотреть файл

@ -3,8 +3,8 @@
<Identifier Id="NUnitTestAdapterInstall..7c53286e-ac4f-485f-915c-5ec5a4c47b0c">
<Name>NUnit Test Adapter</Name>
<Author>Charlie Poole</Author>
<Version>1.0.0.0</Version>
<Description xml:space="preserve">NUnit adapter for integrated test execution under Visual Studio 2012 RTM, Update 1-4,and Visual Studio 2013 Preview. Compatible with NUnit 2.0 through 2.6.2.</Description>
<Version>1.0.0.7</Version>
<Description xml:space="preserve">NUnit adapter for integrated test execution under Visual Studio 2012 RTM, Update 1-4,and Visual Studio 2013. Compatible with NUnit 2.0 through 2.6.2.</Description>
<Locale>1033</Locale>
<MoreInfoUrl>http://nunit.org/index.php?p=vsTestAdapter&amp;r=2.6.2</MoreInfoUrl>
<License>license.rtf</License>

Просмотреть файл

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Moq;
using NUnit.Framework;
@ -87,5 +88,28 @@ namespace NUnit.VisualStudio.TestAdapter.Tests
Assert.That(runner.NUnitFilter.IsEmpty, Is.False, "NUnitfilter should not be empty, we have added testcases");
Assert.That(runner.LoadedTestCases.Count, Is.EqualTo(2), "We should have had 2 converted MS test cases here");
}
//[Test]
//public void HandleTfsFilterCorrectlyWhenFilterIsEmpty()
//{
// var tfsfilter = new Mock<ITfsTestFilter>();
// tfsfilter.Setup(f => f.HasTfsFilterValue).Returns(false);
// var runner = new AssemblyRunner(new TestLogger(), "test", tfsfilter.Object);
// runner.AddTestCases(fakeTest1);
// runner.AddTestCases(fakeTest2);
// Assert.That(runner.NUnitFilter.IsEmpty, Is.False, "NUnitfilter should not be empty, we have added testcases");
// Assert.That(runner.LoadedTestCases.Count, Is.EqualTo(2), "We should have had 2 converted MS test cases here");
//}
//[Test]
//public void HandleTfsFilterCorrectlyWhenNoFilter()
//{
// var runner = new AssemblyRunner(new TestLogger(), "test", (TFSTestFilter)null);
// runner.AddTestCases(fakeTest1);
// runner.AddTestCases(fakeTest2);
// Assert.That(runner.NUnitFilter.IsEmpty, Is.False, "NUnitfilter should not be empty, we have added testcases");
// Assert.That(runner.LoadedTestCases.Count, Is.EqualTo(2), "We should have had 2 converted MS test cases here");
//}
}
}

Просмотреть файл

@ -44,7 +44,11 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\mock-assembly.dll</HintPath>
</Reference>
<Reference Include="nunit.core">
<Reference Include="Moq">
<HintPath>..\..\packages\Moq.4.1.1309.1617\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.core, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\nunit.core.dll</HintPath>
</Reference>
<Reference Include="nunit.core.interfaces">
@ -89,6 +93,12 @@
<Name>NUnitTestAdapter</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Просмотреть файл

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Moq" version="4.1.1309.1617" targetFramework="net45" />
</packages>