mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Tests now build
This commit is contained in:
@@ -5,6 +5,8 @@ VisualStudioVersion = 12.0.30501.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squirrel", "src\Squirrel.csproj", "{1436E22A-FE3C-4D68-9A85-9E74DF2E6A92}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Squirrel.Tests", "test\Squirrel.Tests.csproj", "{98AEB048-E27D-42F4-9440-505B7F78BAFD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{1436E22A-FE3C-4D68-9A85-9E74DF2E6A92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1436E22A-FE3C-4D68-9A85-9E74DF2E6A92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1436E22A-FE3C-4D68-9A85-9E74DF2E6A92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{98AEB048-E27D-42F4-9440-505B7F78BAFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{98AEB048-E27D-42F4-9440-505B7F78BAFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{98AEB048-E27D-42F4-9440-505B7F78BAFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{98AEB048-E27D-42F4-9440-505B7F78BAFD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace System.Linq
|
||||
namespace Squirrel
|
||||
{
|
||||
internal static class EnumerableExtensions
|
||||
{
|
||||
|
||||
1779
src/MarkdownSharp.cs
Normal file
1779
src/MarkdownSharp.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,3 +34,4 @@ using System.Runtime.InteropServices;
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: InternalsVisibleTo("Squirrel.Tests")]
|
||||
|
||||
@@ -30,8 +30,22 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\ext\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.XmlTransform">
|
||||
<HintPath>..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NuGet.Core, Version=2.8.50506.491, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NuGet.Core.2.8.2\lib\net40-Client\NuGet.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Splat">
|
||||
<HintPath>..\packages\Splat.1.4.0\lib\Net45\Splat.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -39,8 +53,20 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="BinaryPatchUtility.cs" />
|
||||
<Compile Include="ContentType.cs" />
|
||||
<Compile Include="DeltaPackage.cs" />
|
||||
<Compile Include="EnumerableExtensions.cs" />
|
||||
<Compile Include="MarkdownSharp.cs" />
|
||||
<Compile Include="PackageExtensions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ReleaseEntry.cs" />
|
||||
<Compile Include="ReleaseExtensions.cs" />
|
||||
<Compile Include="ReleasePackage.cs" />
|
||||
<Compile Include="Utility.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -4,12 +4,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Squirrel.Core;
|
||||
using Squirrel;
|
||||
using Squirrel.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
using Xunit.Extensions;
|
||||
using Assert = Xunit.Assert;
|
||||
|
||||
namespace Squirrel.Tests.Core
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using NuGet;
|
||||
using ReactiveUIMicro;
|
||||
using Squirrel.Client;
|
||||
using Squirrel.Core;
|
||||
using Splat;
|
||||
using Squirrel;
|
||||
using Squirrel.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
|
||||
@@ -52,6 +50,9 @@ namespace Squirrel.Tests.Core
|
||||
[Fact]
|
||||
public void ApplyMultipleDeltaPackagesGeneratesCorrectHash()
|
||||
{
|
||||
Assert.False(true, "UpdateManager not ready yet");
|
||||
|
||||
/*
|
||||
var firstRelease = new ReleasePackage(IntegrationTestHelper.GetPath("fixtures", "SquirrelDesktopDemo-1.0.0-full.nupkg"), true);
|
||||
var secondRelease = new ReleasePackage(IntegrationTestHelper.GetPath("fixtures", "SquirrelDesktopDemo-1.1.0-full.nupkg"), true);
|
||||
var thirdRelease = new ReleasePackage(IntegrationTestHelper.GetPath("fixtures", "SquirrelDesktopDemo-1.2.0-full.nupkg"), true);
|
||||
@@ -63,7 +64,6 @@ namespace Squirrel.Tests.Core
|
||||
var firstDelta = Path.Combine(releasesDir, "SquirrelDesktopDemo-1.1.0-delta.nupkg");
|
||||
var secondDelta = Path.Combine(releasesDir, "SquirrelDesktopDemo-1.2.0-delta.nupkg");
|
||||
|
||||
|
||||
new[] { firstRelease, secondRelease, thirdRelease }
|
||||
.ForEach(file =>
|
||||
{
|
||||
@@ -115,6 +115,7 @@ namespace Squirrel.Tests.Core
|
||||
Assert.Empty(invalidFiles);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Moq;
|
||||
using Squirrel.Core;
|
||||
using Squirrel;
|
||||
using Squirrel.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
using Xunit.Extensions;
|
||||
|
||||
namespace Squirrel.Tests.Core
|
||||
{
|
||||
@@ -81,8 +79,7 @@ namespace Squirrel.Tests.Core
|
||||
[Fact]
|
||||
public void WhenCurrentReleaseMatchesLastReleaseReturnNull()
|
||||
{
|
||||
var package = Mock.Of<IReleasePackage>(
|
||||
r => r.InputPackageFile == "Espera-1.7.6-beta.nupkg");
|
||||
var package = new ReleasePackage("Espera-1.7.6-beta.nupkg");
|
||||
|
||||
var releaseEntries = new[] {
|
||||
ReleaseEntry.ParseReleaseEntry(MockReleaseEntry("Espera-1.7.6-beta.nupkg"))
|
||||
@@ -95,8 +92,7 @@ namespace Squirrel.Tests.Core
|
||||
public void WhenMultipleReleaseMatchesReturnEarlierResult()
|
||||
{
|
||||
var expected = new Version("1.7.5");
|
||||
var package = Mock.Of<IReleasePackage>(
|
||||
r => r.InputPackageFile == "Espera-1.7.6-beta.nupkg");
|
||||
var package = new ReleasePackage("Espera-1.7.6-beta.nupkg");
|
||||
|
||||
var releaseEntries = new[] {
|
||||
ReleaseEntry.ParseReleaseEntry(MockReleaseEntry("Espera-1.7.6-beta.nupkg")),
|
||||
@@ -115,8 +111,7 @@ namespace Squirrel.Tests.Core
|
||||
public void WhenMultipleReleasesFoundReturnPreviousVersion()
|
||||
{
|
||||
var expected = new Version("1.7.6");
|
||||
var input = Mock.Of<IReleasePackage>(
|
||||
r => r.InputPackageFile == "Espera-1.7.7-beta.nupkg");
|
||||
var input = new ReleasePackage("Espera-1.7.7-beta.nupkg");
|
||||
|
||||
var releaseEntries = new[] {
|
||||
ReleaseEntry.ParseReleaseEntry(MockReleaseEntry("Espera-1.7.6-beta.nupkg")),
|
||||
@@ -135,8 +130,7 @@ namespace Squirrel.Tests.Core
|
||||
public void WhenMultipleReleasesFoundInOtherOrderReturnPreviousVersion()
|
||||
{
|
||||
var expected = new Version("1.7.6");
|
||||
var input = Mock.Of<IReleasePackage>(
|
||||
r => r.InputPackageFile == "Espera-1.7.7-beta.nupkg");
|
||||
var input = new ReleasePackage("Espera-1.7.7-beta.nupkg");
|
||||
|
||||
var releaseEntries = new[] {
|
||||
ReleaseEntry.ParseReleaseEntry(MockReleaseEntry("Espera-1.7.5-beta.nupkg")),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System.Runtime.Versioning;
|
||||
using MarkdownSharp;
|
||||
using NuGet;
|
||||
using ReactiveUIMicro;
|
||||
using Squirrel.Core;
|
||||
using Squirrel;
|
||||
using Squirrel.Tests.TestHelpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,6 +9,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Linq;
|
||||
using Splat;
|
||||
using Xunit;
|
||||
|
||||
namespace Squirrel.Tests.Core
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<AssemblyName>Squirrel.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NuGetPackageImportStamp>2c7138af</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -31,6 +32,9 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\ext\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.XmlTransform">
|
||||
<HintPath>..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -51,12 +55,29 @@
|
||||
<Reference Include="xunit.abstractions">
|
||||
<HintPath>..\packages\xunit.abstractions.2.0.0-beta-build2700\lib\net35\xunit.abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.assert">
|
||||
<HintPath>..\packages\xunit.assert.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monoandroid+monotouch10\xunit.assert.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.core">
|
||||
<HintPath>..\packages\xunit.core.2.0.0-beta-build2700\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid\xunit.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.runner.utility">
|
||||
<HintPath>..\packages\xunit.runner.utility.2.0.0-beta-build2700\lib\net35\xunit.runner.utility.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ContentTypeTests.cs" />
|
||||
<Compile Include="DeltaPackageTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ReleaseEntryTests.cs" />
|
||||
<Compile Include="ReleasePackageTests.cs" />
|
||||
<Compile Include="TestHelpers\AssertExtensions.cs" />
|
||||
<Compile Include="TestHelpers\ExposedClass.cs" />
|
||||
<Compile Include="TestHelpers\ExposedObject.cs" />
|
||||
<Compile Include="TestHelpers\ExposedObjectHelper.cs" />
|
||||
<Compile Include="TestHelpers\IntegrationTestHelper.cs" />
|
||||
<Compile Include="TestHelpers\StaticHttpServer.cs" />
|
||||
<Compile Include="UtilityTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\src\Squirrel.csproj">
|
||||
@@ -67,6 +88,9 @@
|
||||
<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>
|
||||
|
||||
@@ -3,14 +3,10 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading;
|
||||
using Ionic.Zip;
|
||||
using Squirrel.Core;
|
||||
using ReactiveUIMicro;
|
||||
using Squirrel.Tests.WiXUi;
|
||||
using Squirrel;
|
||||
using Splat;
|
||||
|
||||
namespace Squirrel.Tests.TestHelpers
|
||||
{
|
||||
@@ -73,7 +69,10 @@ namespace Squirrel.Tests.TestHelpers
|
||||
// like this, is to make sure that we don't have two tests registering
|
||||
// their Service Locators with RxApp.
|
||||
Monitor.Enter(gate);
|
||||
return new CompositeDisposable(ret, Disposable.Create(() => Monitor.Exit(gate)));
|
||||
return Disposable.Create(() => {
|
||||
ret.Dispose();
|
||||
Monitor.Exit(gate);
|
||||
});
|
||||
}
|
||||
|
||||
public static IDisposable WithFakeInstallDirectory(out string path)
|
||||
@@ -94,7 +93,10 @@ namespace Squirrel.Tests.TestHelpers
|
||||
zf.ExtractAll(path);
|
||||
|
||||
Monitor.Enter(gate);
|
||||
return new CompositeDisposable(ret, Disposable.Create(() => Monitor.Exit(gate)));
|
||||
return Disposable.Create(() => {
|
||||
ret.Dispose();
|
||||
Monitor.Exit(gate);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Squirrel.Tests
|
||||
{
|
||||
@@ -30,9 +29,11 @@ namespace Squirrel.Tests
|
||||
server.Prefixes.Add(String.Format("http://+:{0}/", Port));
|
||||
server.Start();
|
||||
|
||||
var listener = Observable.Defer(() => Observable.FromAsyncPattern<HttpListenerContext>(server.BeginGetContext, server.EndGetContext)())
|
||||
.Repeat()
|
||||
.Subscribe(ctx => {
|
||||
bool shouldStop = false;
|
||||
var listener = Task.Run(async () => {
|
||||
while (!shouldStop) {
|
||||
var ctx = await server.GetContextAsync();
|
||||
|
||||
if (ctx.Request.HttpMethod != "GET") {
|
||||
closeResponseWith(ctx, 400, "GETs only");
|
||||
return;
|
||||
@@ -60,11 +61,14 @@ namespace Squirrel.Tests
|
||||
} catch (Exception ex) {
|
||||
closeResponseWith(ctx, 500, ex.ToString());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var ret = Disposable.Create(() => {
|
||||
listener.Dispose();
|
||||
shouldStop = true;
|
||||
server.Stop();
|
||||
listener.Wait(2000);
|
||||
|
||||
inner = null;
|
||||
});
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using ReactiveUIMicro;
|
||||
using Squirrel.Core;
|
||||
using Splat;
|
||||
using Squirrel;
|
||||
using Squirrel.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user