Skip to content

Commit

Permalink
Merge pull request #5054 from Particular/hotfix-6.4.2
Browse files Browse the repository at this point in the history
Installing .NET Framework 4.7.1 can cause an endpoint to fail to start
  • Loading branch information
timbussmann committed Oct 26, 2017
2 parents e350a5a + 2d8a4cf commit da682c0
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/NServiceBus.Core.Tests/API/APIApprovals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using ApprovalTests;
using NUnit.Framework;
using PublicApiGenerator;

Expand All @@ -15,7 +14,7 @@ public class APIApprovals
public void ApproveNServiceBus()
{
var publicApi = Filter(ApiGenerator.GeneratePublicApi(typeof(Endpoint).Assembly));
Approvals.Verify(publicApi);
TestApprover.Verify(publicApi);
}

string Filter(string text)
Expand Down
1 change: 1 addition & 0 deletions src/NServiceBus.Core.Tests/NServiceBus.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<Compile Include="Routing\Routers\UnicastSendRouterTests.cs" />
<Compile Include="Routing\Routers\UnicastSendRouteOptionsTests.cs" />
<Compile Include="Routing\TypeRouteSourceTests.cs" />
<Compile Include="TestApprover.cs" />
<Compile Include="Transports\Learning\HeaderSerializerTests.cs" />
<Compile Include="Transports\Learning\AsyncFileTests.cs" />
<Compile Include="Transports\Learning\LearningTransportDispatcherTests.cs" />
Expand Down
7 changes: 3 additions & 4 deletions src/NServiceBus.Core.Tests/Pipeline/PipelineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using ApprovalTests;
using Extensibility;
using NServiceBus.Pipeline;
using NUnit.Framework;
Expand Down Expand Up @@ -39,7 +38,7 @@ public async Task ShouldExecutePipeline()

await pipeline.Invoke(context);

Approvals.Verify(stringWriter.ToString());
TestApprover.Verify(stringWriter.ToString());
}

[Test]
Expand Down Expand Up @@ -73,7 +72,7 @@ public async Task ShouldNotCacheContext()

await pipeline.Invoke(context);

Approvals.Verify(stringWriter.ToString());
TestApprover.Verify(stringWriter.ToString());
}

[Test]
Expand All @@ -94,7 +93,7 @@ public void ShouldCreateCachedExecutionPlan()
var expressions = new List<Expression>();
behaviors.CreatePipelineExecutionExpression(expressions);

Approvals.Verify(expressions.PrettyPrint());
TestApprover.Verify(expressions.PrettyPrint());
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ namespace NServiceBus.Core.Tests.Sagas.TypeBasedSagas
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ApprovalTests;
using NServiceBus.Sagas;
using NUnit.Framework;

Expand All @@ -14,7 +13,7 @@ public class When_saga_has_multiple_correlated_properties
public void Should_throw()
{
var exception = Assert.Throws<Exception>(() => SagaMetadata.Create(typeof(SagaWithMultipleCorrelatedProperties), new List<Type>(), new Conventions()));
Approvals.Verify(exception.Message);
TestApprover.Verify(exception.Message);
}

class SagaWithMultipleCorrelatedProperties : Saga<SagaWithMultipleCorrelatedProperties.MyEntity>,
Expand Down
3 changes: 1 addition & 2 deletions src/NServiceBus.Core.Tests/StructConventionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace NServiceBus.Core.Tests
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using ApprovalTests;
using NUnit.Framework;

[TestFixture]
Expand Down Expand Up @@ -47,7 +46,7 @@ public void ApproveStructsWhichDontFollowStructGuidelines()
approvalBuilder.AppendLine();
}

Approvals.Verify(approvalBuilder.ToString());
TestApprover.Verify(approvalBuilder.ToString());
}

static void InspectWhetherStructViolatesMutabilityRules(Type type, List<string> violatedRules)
Expand Down
31 changes: 31 additions & 0 deletions src/NServiceBus.Core.Tests/TestApprover.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace NServiceBus.Core.Tests
{
using System.IO;
using ApprovalTests;
using ApprovalTests.Namers;

static class TestApprover
{
public static void Verify(string text)
{
var writer = new ApprovalTextWriter(text);
var namer = new ApprovalNamer();
Approvals.Verify(writer, namer, Approvals.GetReporter());
}

class ApprovalNamer : UnitTestFrameworkNamer
{
public ApprovalNamer()
{
var assemblyPath = GetType().Assembly.Location;
var assemblyDir = Path.GetDirectoryName(assemblyPath);

sourcePath = Path.Combine(assemblyDir, "..", "..", "ApprovalFiles");
}

public override string SourcePath => sourcePath;

readonly string sourcePath;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace NServiceBus.Core.Tests.Transports.Learning
{
using System.Collections.Generic;
using ApprovalTests;
using NUnit.Framework;

public class HeaderSerializerTests
Expand All @@ -22,7 +21,7 @@ public void Can_round_trip_headers()
};
var serialized = HeaderSerializer.Serialize(input);

Approvals.Verify(serialized);
TestApprover.Verify(serialized);
var deserialize = HeaderSerializer.Deserialize(serialized);
CollectionAssert.AreEquivalent(input, deserialize);
}
Expand Down
5 changes: 5 additions & 0 deletions src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ internal static bool IsRuntimeAssembly(AssemblyName assemblyName)
return true;
}

if (lowerInvariant == "cc7b13ffcd2ddd51")
{
return true;
}

return false;
}

Expand Down

0 comments on commit da682c0

Please sign in to comment.