Giter Club home page Giter Club logo

Comments (8)

billyzkid avatar billyzkid commented on May 18, 2024 1

My bad. It does seem to work. I guess when it updated my nuget reference, there was a lingering nuget .targets file which looked to be referencing the previous version of SimpleStubs. Probably something to do with my recent upgrade to VS 2017, who knows... Thanks!

from simplestubs.

nehmebilal avatar nehmebilal commented on May 18, 2024

Hi @Portikus,

Thanks for reporting this issue! Should be a quick fix.

from simplestubs.

nehmebilal avatar nehmebilal commented on May 18, 2024

The issue has been resolved in master. I will publish the fix with the next NuGet.

from simplestubs.

billyzkid avatar billyzkid commented on May 18, 2024

Hi! When can we expect the updated nuget with this fix? This bug is a blocker for me. Thanks!

from simplestubs.

nehmebilal avatar nehmebilal commented on May 18, 2024

Sorry for the delay. I will publish the NuGet this week.

from simplestubs.

nehmebilal avatar nehmebilal commented on May 18, 2024

Just released 2.3.4 which fixes this issue. Please reopen if you have any problems.

from simplestubs.

billyzkid avatar billyzkid commented on May 18, 2024

I am still seeing the same issue with the 2.3.4 release. Can someone please verify? Here is my test interface and the generated stub that fails to build:

public interface ISomeInterface
{
    event EventHandler<IEnumerable<string>> SomeEvent;
}

This fails with "Argument 2: cannot convert from 'System.Collections.IEnumerable' to 'System.Collections.Generic.IEnumerable'":

[CompilerGenerated]
public class StubISomeInterface : ISomeInterface
{
    private readonly StubContainer<StubISomeInterface> _stubs = new StubContainer<StubISomeInterface>();

    public event global::System.EventHandler<global::System.Collections.Generic.IEnumerable<string>> SomeEvent;

    protected void On_SomeEvent(object sender, IEnumerable args)
    {
        global::System.EventHandler<global::System.Collections.Generic.IEnumerable<string>> handler = SomeEvent;
        if (handler != null) { handler(sender, args); }
    }

    public void SomeEvent_Raise(object sender, IEnumerable args)
    {
        On_SomeEvent(sender, args);
    }
}

from simplestubs.

nehmebilal avatar nehmebilal commented on May 18, 2024

I just created a class library and installed 2.3.4 to it.

I am getting:

    [CompilerGenerated]
    public class StubISomeInterface : ISomeInterface
    {
        private readonly StubContainer<StubISomeInterface> _stubs = new StubContainer<StubISomeInterface>();

        public MockBehavior MockBehavior { get; set; }

        public event global::System.EventHandler<global::System.Collections.Generic.IEnumerable<string>> SomeEvent;

        protected void On_SomeEvent(object sender, global::System.Collections.Generic.IEnumerable<string> args)
        {
            global::System.EventHandler<global::System.Collections.Generic.IEnumerable<string>> handler = SomeEvent;
            if (handler != null) { handler(sender, args); }
        }

        public void SomeEvent_Raise(object sender, global::System.Collections.Generic.IEnumerable<string> args)
        {
            On_SomeEvent(sender, args);
        }

        public StubISomeInterface(MockBehavior mockBehavior = MockBehavior.Loose)
        {
            MockBehavior = mockBehavior;
        }
    }

from simplestubs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.