Giter VIP home page Giter VIP logo

swift-mock's People

Contributors

dependabot[bot] avatar metalheadsanya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

swift-mock's Issues

Append verifyNoInteractions() function

This function should get mock/mocks and check, that there is no interaction with this mock/mocks at this moment.

For InOrder this should be method without arguments and check that there is no interaction with stored mocks.

`verify` doesn't fail the test

I noticed that verify doesn't fail the test when the call count doesn't match. I eventually figured out that there's a global closure variable, testFailureReport, that verify calls to report a test failure. But the testFailureReport closure by default doesn't do anything. What's the reason for this? I also haven't found this mentioned in the documentation, that one needs to set testFailureReport to something useful.

Append verifyNoMoreInteractions() function

This function should check that all interactions with mock was checked.

For InOrder this should be method and check that last there is no more interactions with passed mocks after last checked.

Add support for @Mock to extension of a protocol

To enable clean separation of testing and production code it would be nice to be able to place @mock on an extension of a protocol.

Production code:
protocol MyAwesomeProtocol {
func doAmazingThings()
}

Test code:
@mock
extension MyAwesomeProtocol {}

This will add the MyAwesomeProtocolMock in the testing code instead of the production code.

Do not generate default values for generic parameters

Due swift language structure using any() for ArgumentMatcher<T> is not possible.

Instead of that framework user should use any<T>(type: T.self) and provide type for stubbing.

We shouldn't generate default value for generic parameters.

Point verify failure to `verify` call

If one sets testFailureReport to { XCTFail($0) } and verify fails the test, there's no clear indication of why the test failed. One needs to go to the Issue navigator in Xcode to see the exact failure. It would be nice if the test failure pointed to the call to verify in the test.

Support diagnostic

The compiler should give the correct error messages why it is impossible to create a mock for the protocol at the moment.

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.