Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GitHubVS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{72036B62-2
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "src\UnitTests\UnitTests.csproj", "{596595A6-2A3C-469E-9386-9E3767D863A5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "test\UnitTests\UnitTests.csproj", "{596595A6-2A3C-469E-9386-9E3767D863A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.UI", "src\GitHub.UI\GitHub.UI.csproj", "{346384DD-2445-4A28-AF22-B45F3957BD89}"
EndProject
Expand Down Expand Up @@ -95,7 +95,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CredentialManagement", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Testing_Net45", "submodules\reactiveui\ReactiveUI.Testing\ReactiveUI.Testing_Net45.csproj", "{DD99FD0F-82F6-4C30-930E-4A1D0DF01D65}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrackingCollectionTests", "src\TrackingCollectionTests\TrackingCollectionTests.csproj", "{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrackingCollectionTests", "test\TrackingCollectionTests\TrackingCollectionTests.csproj", "{7B835A7D-CF94-45E8-B191-96F5A4FE26A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.TeamFoundation.14", "src\GitHub.TeamFoundation.14\GitHub.TeamFoundation.14.csproj", "{161DBF01-1DBF-4B00-8551-C5C00F26720D}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion script
14 changes: 7 additions & 7 deletions scripts/Run-NUnit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ Param(

$rootDirectory = Split-Path (Split-Path $MyInvocation.MyCommand.Path)
Push-Location $rootDirectory
$dll = "src\$Project\bin\$Configuration\$Project.dll"
$dll = "test\$Project\bin\$Configuration\$Project.dll"

if ($AppVeyor) {
$nunitDirectory = Join-Path $rootDirectory packages\NUnit.Runners.2.6.4\tools
$consoleRunner = Join-Path $nunitDirectory nunit-console-x86.exe
$args = "-noshadow", "-framework:net-4.5", "-exclude:Timings", $dll
$nunitDirectory = Join-Path $rootDirectory packages\NUnit.ConsoleRunner.3.7.0\tools
$consoleRunner = Join-Path $nunitDirectory nunit3-console.exe
$args = "--framework:net-4.5", "--where:cat!=Timings", $dll
[object[]] $output = "$consoleRunner " + ($args -join " ")
& $consoleRunner ($args | %{ "`"$_`"" })
if($LastExitCode -ne 0) {
$host.SetShouldExit($LastExitCode)
}
} else {
$nunitDirectory = Join-Path $rootDirectory packages\NUnit.Runners.2.6.4\tools
$consoleRunner = Join-Path $nunitDirectory nunit-console-x86.exe
$nunitDirectory = Join-Path $rootDirectory packages\NUnit.ConsoleRunner.3.7.0\tools
$consoleRunner = Join-Path $nunitDirectory nunit3-console.exe

$xml = Join-Path $rootDirectory "nunit-$Project.xml"
$outputPath = [System.IO.Path]::GetTempFileName()

$args = "-noshadow", "-xml:$xml", "-framework:net-4.5", "-exclude:Timings", $dll
$args = "--result=$xml", "--framework:net-4.5", "--where:cat!=Timings", $dll
[object[]] $output = "$consoleRunner " + ($args -join " ")

$process = Start-Process -PassThru -NoNewWindow -RedirectStandardOutput $outputPath $consoleRunner ($args | %{ "`"$_`"" })
Expand Down
2 changes: 1 addition & 1 deletion scripts/Run-XUnit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Param(
$rootDirectory = Split-Path (Split-Path $MyInvocation.MyCommand.Path)
Push-Location $rootDirectory

$dll = "src\$Project\bin\$Configuration\$Project.dll"
$dll = "test\$Project\bin\$Configuration\$Project.dll"

if ($AppVeyor) {
$xunitDirectory = Join-Path $rootDirectory packages\xunit.runner.console.2.1.0\tools
Expand Down
8 changes: 0 additions & 8 deletions test.cmd

This file was deleted.

3 changes: 3 additions & 0 deletions test/GitHub.UI.UnitTests/GitHub.UI.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
25 changes: 15 additions & 10 deletions test/GitHub.UI.UnitTests/Helpers/SharedDictionaryManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,30 @@ public void CalledTwice_DisposeNotCalled()
var disposable = Substitute.For<IDisposable>();
factory.TryAddDisposable(disposable);

SharedDictionaryManager.GetCurrentDomainCachingFactory();

disposable.Received(0).Dispose();
using (SharedDictionaryManager.GetCurrentDomainCachingFactory())
{
disposable.Received(0).Dispose();
}
}
}

[Test]
public void InvokeMethodOnNewAssembly_DisposeCalled()
{
using (var factory = SharedDictionaryManager.GetCurrentDomainCachingFactory())
// HACK: Why does this need to be in app domain?
AppDomainContext.Invoke(new AppDomainSetup { ApplicationBase = AppDomain.CurrentDomain.BaseDirectory }, () =>
{
var disposable = Substitute.For<IDisposable>();
factory.TryAddDisposable(disposable);

using (InvokeMethodOnNewAssembly(SharedDictionaryManager.GetCurrentDomainCachingFactory))
using (var factory = SharedDictionaryManager.GetCurrentDomainCachingFactory())
{
disposable.Received(1).Dispose();
var disposable = Substitute.For<IDisposable>();
factory.TryAddDisposable(disposable);

using (InvokeMethodOnNewAssembly(SharedDictionaryManager.GetCurrentDomainCachingFactory))
{
disposable.Received(1).Dispose();
}
}
}
});
}

static IDisposable InvokeMethodOnNewAssembly<T>(Func<T> func)
Expand Down
1 change: 1 addition & 0 deletions test/GitHub.UI.UnitTests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<packages>
<package id="NSubstitute" version="2.0.2" targetFramework="net461" />
<package id="NUnit" version="3.6.1" targetFramework="net461" />
<package id="NUnit.ConsoleRunner" version="3.7.0" targetFramework="net461" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ public void RemovingWithNoObservableSetThrows()
}

[Test]
public async void AddingBeforeSubscribingWorks()
public async Task AddingBeforeSubscribingWorks()
{
ITrackingCollection<Thing> col = new TrackingCollection<Thing>(Observable.Empty<Thing>());
ReplaySubject<Thing> done = new ReplaySubject<Thing>();
Expand All @@ -1993,7 +1993,7 @@ public async void AddingBeforeSubscribingWorks()
done.OnNext(t);
if (++count == 2)
done.OnCompleted();
}, () => {});
}, () => { });

await Observable.Timeout(done, TimeSpan.FromMilliseconds(500));
Assert.AreEqual(2, col.Count);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
Expand Down Expand Up @@ -42,26 +43,10 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.core, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.core.interfaces, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.util, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="NUnit.VisualStudio.TestAdapter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4cb40d35494691ac, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Reactive.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=62aa029873c516b4, processorArchitecture=MSIL">
<HintPath>..\..\packages\Rx-Core.2.2.5-custom\lib\net45\System.Reactive.Core.dll</HintPath>
Expand Down Expand Up @@ -118,15 +103,15 @@
<Project>{252ce1c2-027a-4445-a3c2-e4d6c80a935a}</Project>
<Name>Splat-Net45</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Exports.Reactive\GitHub.Exports.Reactive.csproj">
<ProjectReference Include="..\..\src\GitHub.Exports.Reactive\GitHub.Exports.Reactive.csproj">
<Project>{e4ed0537-d1d9-44b6-9212-3096d7c3f7a1}</Project>
<Name>GitHub.Exports.Reactive</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Exports\GitHub.Exports.csproj">
<ProjectReference Include="..\..\src\GitHub.Exports\GitHub.Exports.csproj">
<Project>{9aea02db-02b5-409c-b0ca-115d05331a6b}</Project>
<Name>GitHub.Exports</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Extensions\GitHub.Extensions.csproj">
<ProjectReference Include="..\..\src\GitHub.Extensions\GitHub.Extensions.csproj">
<Project>{6afe2e2d-6db0-4430-a2ea-f5f5388d2f78}</Project>
<Name>GitHub.Extensions</Name>
</ProjectReference>
Expand All @@ -151,6 +136,12 @@
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<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.8.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.8.0\build\net35\NUnit3TestAdapter.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net452" />
<package id="NUnit.Runners" version="2.6.4" targetFramework="net452" />
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net452" />
<package id="NUnit" version="3.6.1" targetFramework="net461" />
<package id="NUnit.ConsoleRunner" version="3.7.0" targetFramework="net461" />
<package id="NUnit3TestAdapter" version="3.8.0" targetFramework="net461" />
<package id="Rx-Core" version="2.2.5-custom" targetFramework="net452" />
<package id="Rx-Interfaces" version="2.2.5-custom" targetFramework="net452" />
<package id="Rx-Linq" version="2.2.5-custom" targetFramework="net452" />
Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions src/UnitTests/UnitTests.csproj → test/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -313,55 +313,55 @@
<Project>{252ce1c2-027a-4445-a3c2-e4d6c80a935a}</Project>
<Name>Splat-Net45</Name>
</ProjectReference>
<ProjectReference Include="..\DesignTimeStyleHelper\DesignTimeStyleHelper.csproj">
<ProjectReference Include="..\..\src\DesignTimeStyleHelper\DesignTimeStyleHelper.csproj">
<Project>{b1f5c227-456f-437d-bd5f-4c11b7a8d1a0}</Project>
<Name>DesignTimeStyleHelper</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Api\GitHub.Api.csproj">
<ProjectReference Include="..\..\src\GitHub.Api\GitHub.Api.csproj">
<Project>{b389adaf-62cc-486e-85b4-2d8b078df763}</Project>
<Name>GitHub.Api</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.App\GitHub.App.csproj">
<ProjectReference Include="..\..\src\GitHub.App\GitHub.App.csproj">
<Project>{1A1DA411-8D1F-4578-80A6-04576BEA2DC5}</Project>
<Name>GitHub.App</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Exports.Reactive\GitHub.Exports.Reactive.csproj">
<ProjectReference Include="..\..\src\GitHub.Exports.Reactive\GitHub.Exports.Reactive.csproj">
<Project>{e4ed0537-d1d9-44b6-9212-3096d7c3f7a1}</Project>
<Name>GitHub.Exports.Reactive</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Exports\GitHub.Exports.csproj">
<ProjectReference Include="..\..\src\GitHub.Exports\GitHub.Exports.csproj">
<Project>{9AEA02DB-02B5-409C-B0CA-115D05331A6B}</Project>
<Name>GitHub.Exports</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Extensions.Reactive\GitHub.Extensions.Reactive.csproj">
<ProjectReference Include="..\..\src\GitHub.Extensions.Reactive\GitHub.Extensions.Reactive.csproj">
<Project>{6559e128-8b40-49a5-85a8-05565ed0c7e3}</Project>
<Name>GitHub.Extensions.Reactive</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.Extensions\GitHub.Extensions.csproj">
<ProjectReference Include="..\..\src\GitHub.Extensions\GitHub.Extensions.csproj">
<Project>{6afe2e2d-6db0-4430-a2ea-f5f5388d2f78}</Project>
<Name>GitHub.Extensions</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.InlineReviews\GitHub.InlineReviews.csproj">
<ProjectReference Include="..\..\src\GitHub.InlineReviews\GitHub.InlineReviews.csproj">
<Project>{7f5ed78b-74a3-4406-a299-70cfb5885b8b}</Project>
<Name>GitHub.InlineReviews</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.TeamFoundation.14\GitHub.TeamFoundation.14.csproj">
<ProjectReference Include="..\..\src\GitHub.TeamFoundation.14\GitHub.TeamFoundation.14.csproj">
<Project>{161DBF01-1DBF-4B00-8551-C5C00F26720D}</Project>
<Name>GitHub.TeamFoundation.14</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
<ProjectReference Include="..\..\src\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj">
<Project>{158B05E8-FDBC-4D71-B871-C96E28D5ADF5}</Project>
<Name>GitHub.UI.Reactive</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.UI\GitHub.UI.csproj">
<ProjectReference Include="..\..\src\GitHub.UI\GitHub.UI.csproj">
<Project>{346384dd-2445-4a28-af22-b45f3957bd89}</Project>
<Name>GitHub.UI</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.VisualStudio.UI\GitHub.VisualStudio.UI.csproj">
<ProjectReference Include="..\..\src\GitHub.VisualStudio.UI\GitHub.VisualStudio.UI.csproj">
<Project>{d1dfbb0c-b570-4302-8f1e-2e3a19c41961}</Project>
<Name>GitHub.VisualStudio.UI</Name>
</ProjectReference>
<ProjectReference Include="..\GitHub.VisualStudio\GitHub.VisualStudio.csproj">
<ProjectReference Include="..\..\src\GitHub.VisualStudio\GitHub.VisualStudio.csproj">
<Project>{11569514-5ae5-4b5b-92a2-f10b0967de5f}</Project>
<Name>GitHub.VisualStudio</Name>
</ProjectReference>
Expand Down
File renamed without changes.