Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix failing tests because additional interfaces are included in proxy…
… name

The only way to now generate proxies that do not contain the additional
interface names in the proxy name is by using the MEF document visitors.

This simplifies the code and makes it easier to reuse from the code fixes.
  • Loading branch information
kzu committed Jul 8, 2017
commit d48a934513e516ab90d88eb8c691eb752b76db98
6 changes: 3 additions & 3 deletions test/Proxy.Tests/ProxyGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ public class ProxyGeneratorTests
[InlineData(LanguageNames.CSharp)]
[InlineData(LanguageNames.VisualBasic)]
[Theory]
public async Task GeneratedProxyDoesNotContainAdditionalInterfaceInName(string languageName)
public async Task GeneratedProxyNameContainsAdditionalInterfaceInName(string languageName)
{
var compilation = await CanGenerateProxy(languageName, typeof(INotifyPropertyChanged), typeof(IDisposable));
var assembly = compilation.Emit();
var proxyType = assembly.GetExportedTypes().FirstOrDefault();

Assert.NotNull(proxyType);
Assert.True(typeof(IDisposable).IsAssignableFrom(proxyType));
Assert.False(proxyType.FullName.Contains(nameof(IDisposable)),
$"Generated proxy should not contain the additional type {nameof(IDisposable)} in its name.");
Assert.True(proxyType.FullName.Contains(nameof(IDisposable)),
$"Generated proxy should contain the additional type {nameof(IDisposable)} in its name.");
}

[InlineData(LanguageNames.CSharp)]
Expand Down
1 change: 0 additions & 1 deletion test/Sdk.Tests/GeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public async Task CanGenerateProxies(string languageName)
.Concat(new[] { typeof(GeneratorTests).Assembly.ManifestModule.FullyQualifiedName })
.Select(x => new MSBuild.TaskItem(x)).ToArray(),
AdditionalGenerators = new[] { new MSBuild.TaskItem(typeof(CSharpMocked).Assembly.ManifestModule.FullyQualifiedName) },
AdditionalInterfaces = new[] { new MSBuild.TaskItem(typeof(IMocked).FullName) },
AdditionalProxies = new[] { new MSBuild.TaskItem(typeof(ICalculator).FullName) },
};

Expand Down