Skip to content

Commit

Permalink
Fixed AutoMocking Moq package
Browse files Browse the repository at this point in the history
  • Loading branch information
svermeulen committed Aug 27, 2018
1 parent 2e19e93 commit 0e91195
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Documentation/AutoMocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Then you can implement the fields of the IWebServer interface and configure them

Zenject also allows you to even avoid having to write the MockWebServer class in favour of using a library called "Moq" which does all the work for you.

Note that by default, Auto-mocking is not enabled in Zenject. If you wish to use the auto-mocking feature then you need to go to your Zenject install directory and extract the contents of "Extras/ZenjectAutoMocking.zip". Note that there are multiple versions of Moq.dll included in the zip and that you should use the one that targets the Scripting Runtime Version that you have configured in your player settings. Also note that if you're using Scripting Runtime Version 3.5, that you might also need to change your "Api Compatibility Level" from ".NET 2.0 Subset" to ".NET 2.0"
Note that by default, Auto-mocking is not enabled in Zenject. If you wish to use the auto-mocking feature then you need to go to your Zenject install directory and extract the contents of "OptionalExtras\TestFramework\Editor\AutoMocking.zip" into that same directory. Note that there are multiple versions of Moq.dll included in the zip and that you should use the one that targets the Scripting Runtime Version that you have configured in your player settings. Also note that if you're using Scripting Runtime Version 3.5, that you might also need to change your "Api Compatibility Level" from ".NET 2.0 Subset" to ".NET 2.0"

After extracting the auto mocking package it is just a matter of using the following syntax to mock out various parts of your project:

Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e91195

Please sign in to comment.