Created
March 11, 2018 17:52
-
-
Save Flayed/a7bf14631c1c794dbe31397eac2ca6bd to your computer and use it in GitHub Desktop.
TestBase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestBase : IDisposable | |
| { | |
| public readonly AutoMock Mock; | |
| public TestBase() | |
| { | |
| Mock = AutoMock.GetLoose(); | |
| } | |
| public TImplementation Provide<TInterface, TImplementation>() | |
| where TInterface : class | |
| where TImplementation : TInterface | |
| { | |
| TImplementation impl = Mock.Create<TImplementation>(); | |
| Mock.Provide<TInterface>(impl); | |
| return impl; | |
| } | |
| public void Dispose() | |
| { | |
| Mock.Dispose(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment