Last active
January 12, 2016 08:59
-
-
Save johnmmoss/bc620b20c6889572a8c9 to your computer and use it in GitHub Desktop.
Rhino Mock Setup
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
| private IConnectionManager _connectionManager; | |
| private ISubscriptionManager _subscriptionManager; | |
| [SetUp] | |
| public void SetUp() | |
| { | |
| _connectionManager = MockRepository.GenerateStub<IConnectionManager>(); | |
| _subscriptionManager = MockRepository.GenerateStub<ISubscriptionManager>(); | |
| _connectionManager.Stub(x => x.Connections) | |
| .Return(new ConnectionInfo() | |
| { | |
| ErrorsInLast24Hours = _errorsInLast24Hours | |
| }); | |
| _subscriptionManager.Stub(x => x.GetSubscriptions()) | |
| .Return(new List<SubscriptionInfo>() | |
| { | |
| new SubscriptionInfo() {SystemId = 100} | |
| }); | |
| } | |
| [Test] | |
| public void GetStatistics_returns_the_correct_statistics() | |
| { | |
| var systemInfoProvider = new SystemInfoProvider(_connectionManager, _subscriptionManager); | |
| var result = systemInfoProvider.GetStatistics(); | |
| Assert.That(result, Is.Not.Null); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment