Code Monkey home page Code Monkey logo

fastmoq's Introduction

Hi there ๐Ÿ‘‹

Github Linkedin NuGet

I'm a 25+ years software developer and consultant. About half of that time is with Microsoft.

Solving problems and challenges with code is my passion. Before now, I never published any work, so please keep a look out for new and exciting things.

Technologies: Azure, Sql Server (and other databases), SharePoint, .NET, Blazor, Angular.

Languages: C#, T-SQL, JavaScript, and many more.

Please let me know if you have any ideas!

In my free time, I'm also a sound engineer and producer. My wife is a professional singer, songwriter, and producer: https://youtube.com/playlist?list=PLtHb7y9Z3TYoc5VUhfp1KJjpozVjyiKce

Together we rule our world!

๐Ÿ“ซ How to reach me: https://www.linkedin.com/in/christopherwinland

fastmoq's People

Contributors

cwinland avatar dc-dub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

chtoone

fastmoq's Issues

Add Expression builder

public static Expression<Func<T, bool>> BuildExpression()
{
return It.IsAny<Expression<Func<T, bool>>>();
}

Stack overflow when creating a mock

The mock system will attempt to create mocks for all inner mock constructors.
When InnerMockResolution is true (default), this can cause an endless loop.

To fix this, constructors with the same Type are removed if a valid default value is not provided. Meaning, if the mock is created and parameters are passed to it, then constructor with the same Type in the parameter can be used. However, if a default value is required, then instead of creating a mock, it will exclude that constructor.

#14

Also, to prevent a mock from being creating automatically on a constructor:
Mocks.AddType<DelegatingHandler, DelegatingHandler>(_ => null);

Add group GetMock

Similar to Initialize, add a way to get a mock once and do either multiple setup, verify, or other actions on the mock without getting it for each call.

Split out Web vs non-web

FastMoq vs FastMoq.Core vs FastMoq.Web.

All web packages including Blazor from #10 will be in FastMoq.Web. The original code is FastMoq.Core. FastMoq includes FastMoq.Core and FastMoq.Web.

Easy Way to select which constructor to use when creating from MockerTestBase

MockerTestBase finds the first constructor. If there are two and one is empty, it will select the empty constructor. However, in some cases, the other constructor is required.

Currently, to work around this, code needs to look like this:
protected override Func<Mocker, Model?> CreateComponentAction => mocker => new Model(mocker.GetObject());

This method to select should be able to easily select the constructor without manually creating the object.

Hoping we can have a overridable Expression to do something like this: c=>c.Model(It.IsAny) or some variation.

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.