daveoftheparty / speedy-moq

Generate boilerplate code for Moq in C#
MIT License
1 stars 0 forks source link

defaults should not show in setup() #51

Closed daveoftheparty closed 8 months ago

daveoftheparty commented 2 years ago

This interface:

    public interface IService
    {
        Task<ServiceResponse> FooAsync(string foo, object bar, EventProcessRequest body, CancellationToken cancellationToken = default);
    }

produced this mock setup which is invalid code:

            service
                .Setup(fooAsync)
                .Returns((string foo, object bar, EventProcessRequest body, CancellationToken cancellationToken = default(CancellationToken)) =>
                {
                    return default;
                });

it's the = default(CancellationToken that is the problem