Skip to content

Commit 2a8b1f0

Browse files
authored
Merge pull request #1431 from libgit2/bording/update-tests
Update test project dependencies
2 parents 802aeb4 + a63e81c commit 2a8b1f0

15 files changed

+88
-200
lines changed

.nuget/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="xunit.runner.console" version="2.0.0" />
4-
<package id="xunit.runner.msbuild" version="2.0.0" />
3+
<package id="xunit.runner.console" version="2.2.0" />
4+
<package id="xunit.runner.msbuild" version="2.2.0" />
55
</packages>

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33

44
language: csharp
55
mono:
6-
- 3.12.0
7-
- 4.2.3
6+
- latest
87

98
os:
109
- osx
1110
- linux
1211

13-
# The newer image cannot find mono 3.12 in the PATH
14-
osx_image: xcode6.4
15-
1612
env:
1713
global:
1814
- MONO_OPTIONS=--debug
1915

16+
install:
17+
- curl -L -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
18+
- mono nuget.exe restore LibGit2Sharp.sln
19+
2020
before_install:
2121
- date -u
2222
- uname -a

CI/build.msbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<DeployFolder>$(RootDir)\Build</DeployFolder>
77
</PropertyGroup>
88

9-
<UsingTask AssemblyFile="$(RootDir)\packages\xunit.runner.msbuild.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.runner.msbuild.dll"
9+
<UsingTask AssemblyFile="$(RootDir)\packages\xunit.runner.msbuild.2.2.0\build\net452\xunit.runner.msbuild.dll"
1010
TaskName="Xunit.Runner.MSBuild.xunit" />
1111
<Target Name="Clean">
1212
<Message Text="Commit SHA = $(CommitSha)" />

Lib/NuGet/NuGet.exe

2.79 MB
Binary file not shown.

LibGit2Sharp.Tests/ConfigurationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public static IEnumerable<object[]> ConfigAccessors
366366
}
367367
}
368368

369-
[Theory, PropertyData("ConfigAccessors")]
369+
[Theory, MemberData(nameof(ConfigAccessors))]
370370
public void CanAccessConfigurationWithoutARepository(Func<string, string> localConfigurationPathProvider)
371371
{
372372
var path = SandboxStandardTestRepoGitDir();

LibGit2Sharp.Tests/ConflictFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void CanGetOriginalNamesOfRenameConflicts()
112112
}
113113
}
114114

115-
[Theory, PropertyData("ConflictData")]
115+
[Theory, MemberData(nameof(ConflictData))]
116116
public void CanRetrieveSingleConflictByPath(string filepath, string ancestorId, string ourId, string theirId)
117117
{
118118
var path = SandboxMergedTestRepo();

LibGit2Sharp.Tests/IndexFixture.cs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,28 +158,34 @@ public void CanMoveAnExistingFileOverANonExistingFile(string sourcePath, FileSta
158158
}
159159

160160
[Theory]
161-
[InlineData("README", FileStatus.Unaltered, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
162-
[InlineData("new_tracked_file.txt", FileStatus.NewInIndex, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
163-
[InlineData("modified_staged_file.txt", FileStatus.ModifiedInIndex, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
164-
[InlineData("modified_unstaged_file.txt", FileStatus.ModifiedInWorkdir, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" })]
165-
public void MovingOverAnExistingFileThrows(string sourcePath, FileStatus sourceStatus, IEnumerable<string> destPaths)
161+
[InlineData("README", FileStatus.Unaltered)]
162+
[InlineData("new_tracked_file.txt", FileStatus.NewInIndex)]
163+
[InlineData("modified_staged_file.txt", FileStatus.ModifiedInIndex)]
164+
[InlineData("modified_unstaged_file.txt", FileStatus.ModifiedInWorkdir)]
165+
public void MovingOverAnExistingFileThrows(string sourcePath, FileStatus sourceStatus)
166166
{
167+
var destPaths = new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt" };
168+
167169
InvalidMoveUseCases(sourcePath, sourceStatus, destPaths);
168170
}
169171

170172
[Theory]
171-
[InlineData("new_untracked_file.txt", FileStatus.NewInWorkdir, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
172-
public void MovingAFileWichIsNotUnderSourceControlThrows(string sourcePath, FileStatus sourceStatus, IEnumerable<string> destPaths)
173+
[InlineData("new_untracked_file.txt", FileStatus.NewInWorkdir)]
174+
public void MovingAFileWichIsNotUnderSourceControlThrows(string sourcePath, FileStatus sourceStatus)
173175
{
176+
var destPaths = new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" };
177+
174178
InvalidMoveUseCases(sourcePath, sourceStatus, destPaths);
175179
}
176180

177181
[Theory]
178-
[InlineData("deleted_unstaged_file.txt", FileStatus.DeletedFromWorkdir, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
179-
[InlineData("deleted_staged_file.txt", FileStatus.DeletedFromIndex, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
180-
[InlineData("i_dont_exist.txt", FileStatus.Nonexistent, new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" })]
181-
public void MovingAFileNotInTheWorkingDirectoryThrows(string sourcePath, FileStatus sourceStatus, IEnumerable<string> destPaths)
182+
[InlineData("deleted_unstaged_file.txt", FileStatus.DeletedFromWorkdir)]
183+
[InlineData("deleted_staged_file.txt", FileStatus.DeletedFromIndex)]
184+
[InlineData("i_dont_exist.txt", FileStatus.Nonexistent)]
185+
public void MovingAFileNotInTheWorkingDirectoryThrows(string sourcePath, FileStatus sourceStatus)
182186
{
187+
var destPaths = new[] { "README", "new_tracked_file.txt", "modified_staged_file.txt", "modified_unstaged_file.txt", "new_untracked_file.txt", "deleted_unstaged_file.txt", "deleted_staged_file.txt", "i_dont_exist.txt" };
188+
183189
InvalidMoveUseCases(sourcePath, sourceStatus, destPaths);
184190
}
185191

LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" />
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,9 +11,11 @@
1111
<AppDesignerFolder>Properties</AppDesignerFolder>
1212
<RootNamespace>LibGit2Sharp.Tests</RootNamespace>
1313
<AssemblyName>LibGit2Sharp.Tests</AssemblyName>
14-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
1515
<FileAlignment>512</FileAlignment>
1616
<TargetFrameworkProfile />
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
1719
</PropertyGroup>
1820
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1921
<DebugSymbols>true</DebugSymbols>
@@ -24,6 +26,7 @@
2426
<ErrorReport>prompt</ErrorReport>
2527
<WarningLevel>4</WarningLevel>
2628
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
29+
<Prefer32Bit>false</Prefer32Bit>
2730
</PropertyGroup>
2831
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2932
<DebugType>pdbonly</DebugType>
@@ -33,20 +36,36 @@
3336
<ErrorReport>prompt</ErrorReport>
3437
<WarningLevel>4</WarningLevel>
3538
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
39+
<Prefer32Bit>false</Prefer32Bit>
3640
</PropertyGroup>
3741
<ItemGroup>
38-
<Reference Include="Moq, Version=4.2.1507.118, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Moq.4.2.1507.0118\lib\net40\Moq.dll</HintPath>
42+
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
43+
<HintPath>..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath>
44+
</Reference>
45+
<Reference Include="Moq, Version=4.7.8.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
46+
<HintPath>..\packages\Moq.4.7.8\lib\net45\Moq.dll</HintPath>
4047
</Reference>
4148
<Reference Include="System" />
4249
<Reference Include="System.Core" />
4350
<Reference Include="System.Xml" />
44-
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
45-
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
51+
<Reference Include="Validation, Version=2.4.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL">
52+
<HintPath>..\packages\Validation.2.4.15\lib\net45\Validation.dll</HintPath>
53+
</Reference>
54+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
55+
<HintPath>..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
56+
<Private>True</Private>
57+
</Reference>
58+
<Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
59+
<HintPath>..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
60+
</Reference>
61+
<Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
62+
<HintPath>..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
63+
</Reference>
64+
<Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
65+
<HintPath>..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
4766
</Reference>
48-
<Reference Include="xunit.extensions">
49-
<HintPath>..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
67+
<Reference Include="Xunit.SkippableFact, Version=1.3.0.0, Culture=neutral, PublicKeyToken=b2b52da82b58eb73, processorArchitecture=MSIL">
68+
<HintPath>..\packages\Xunit.SkippableFact.1.3.1\lib\net452\Xunit.SkippableFact.dll</HintPath>
5069
</Reference>
5170
</ItemGroup>
5271
<ItemGroup>
@@ -130,7 +149,6 @@
130149
<Compile Include="TestHelpers\IPostTestDirectoryRemover.cs" />
131150
<Compile Include="TestHelpers\SelfCleaningDirectory.cs" />
132151
<Compile Include="TestHelpers\SignatureExtensions.cs" />
133-
<Compile Include="TestHelpers\SkippableFactAttribute.cs" />
134152
<Compile Include="LogFixture.cs" />
135153
<Compile Include="TestHelpers\TestRemoteRefs.cs" />
136154
<Compile Include="TreeDefinitionFixture.cs" />
@@ -156,9 +174,9 @@
156174
</PropertyGroup>
157175
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
158176
<PropertyGroup>
159-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
177+
<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>
160178
</PropertyGroup>
161-
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props'))" />
179+
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props'))" />
162180
</Target>
163181
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
164182
Other similar extension points exist, see Microsoft.Common.targets.

LibGit2Sharp.Tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
3+
using Xunit;
34

45
// General Information about an assembly is controlled through the following
56
// set of attributes. Change these attribute values to modify the information
@@ -37,3 +38,5 @@
3738

3839
[assembly: AssemblyVersion("1.0.0.0")]
3940
[assembly: AssemblyFileVersion("1.0.0.0")]
41+
42+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

LibGit2Sharp.Tests/StageFixture.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public void CanStageAnUnknownFileWithLaxUnmatchedExplicitPathsValidation(string
101101
Assert.Null(repo.Index[relativePath]);
102102
Assert.Equal(status, repo.RetrieveStatus(relativePath));
103103

104-
Assert.DoesNotThrow(() => Commands.Stage(repo, relativePath));
105-
Assert.DoesNotThrow(() => Commands.Stage(repo, relativePath, new StageOptions { ExplicitPathsOptions = new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false } }));
104+
Commands.Stage(repo, relativePath);
105+
Commands.Stage(repo, relativePath, new StageOptions { ExplicitPathsOptions = new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false } });
106106

107107
Assert.Equal(status, repo.RetrieveStatus(relativePath));
108108
}
@@ -405,8 +405,7 @@ public void CanSuccessfullyStageTheContentOfAModifiedFileOfTheSameSizeWithinTheS
405405

406406
Commands.Stage(repo, "test.txt");
407407

408-
Assert.DoesNotThrow(() => repo.Commit(
409-
"Commit", Constants.Signature, Constants.Signature));
408+
repo.Commit("Commit", Constants.Signature, Constants.Signature);
410409
}
411410
}
412411
}

LibGit2Sharp.Tests/TestHelpers/SkippableFactAttribute.cs

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)