-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support projects with multiple target frameworks #76
Labels
Milestone
Comments
So this is almost working (sorry about the note earlier that I was getting the same error). However, it is generating invalid code in one instance:
[Test]
public void VerifyClassWithPublicConstructor()
{
#if NETCOREAPP2_0
Assert.Ignore("Not applicable for NETCOREAPP2_0");
#else
var factory = new ProxyFactory(new SavingProxyAssemblyBuilder(assemblyName));
var proxyType = factory.CreateProxyType(typeof(ClassWithPublicDefaultConstructor), null);
wasCalled = false;
Activator.CreateInstance(proxyType);
Assert.That(wasCalled);
new PeVerifier(assemblyFileName).AssertIsValid();
#endif
} to [Test]
public Task VerifyClassWithPublicConstructorAsync()
{
try
{
#if NETCOREAPP2_0
Assert.Ignore("Not applicable for NETCOREAPP2_0");
#else
var factory = new ProxyFactory(new SavingProxyAssemblyBuilder(assemblyName));
var proxyType = factory.CreateProxyType(typeof(ClassWithPublicDefaultConstructor), null);
wasCalled = false;
Activator.CreateInstance(proxyType);
Assert.That(wasCalled);
return new PeVerifier(assemblyFileName).AssertIsValidAsync();
}
catch (Exception ex)
{
return Task.FromException<object>(ex);
}
#endif
} The curly braces of the
I would expect something like this: [Test]
public Task VerifyClassWithPublicConstructorAsync()
{
try
{
#if NETCOREAPP2_0
Assert.Ignore("Not applicable for NETCOREAPP2_0");
return Task.CompletedTask;
#else
var factory = new ProxyFactory(new SavingProxyAssemblyBuilder(assemblyName));
var proxyType = factory.CreateProxyType(typeof(ClassWithPublicDefaultConstructor), null);
wasCalled = false;
Activator.CreateInstance(proxyType);
Assert.That(wasCalled);
return new PeVerifier(assemblyFileName).AssertIsValidAsync();
#endif
}
catch (Exception ex)
{
return Task.FromException<object>(ex);
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: