Created
October 25, 2016 19:06
-
-
Save fivunlm/4078d25331da2ee20e440e1fe612ff33 to your computer and use it in GitHub Desktop.
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
[TestClass] | |
public class Test | |
{ | |
private IApplication MockApp(IScreenService screenService, IMessageRouterService messageRouterService, | |
IXACService xacService, IDataService dataService) | |
{ | |
var application = Mock.Interface<IApplication>(); | |
Expect.Once.PropertyGet(() => application.ScreenService).Returns(screenService); | |
Expect.Once.PropertyGet(() => application.MsgRouterService).Returns(messageRouterService); | |
Expect.Once.PropertyGet(() => application.XACService).Returns(xacService); | |
Expect.Once.PropertyGet(() => application.DataService).Returns(dataService); | |
return application; | |
} | |
[TestMethod] | |
public void Test() | |
{ | |
var msgRouterService = Mock.Interface<IMessageRouterService>(); | |
var screenService = Mock.Interface<IScreenService>(); | |
var dataService = Mock.Interface<IDataService>(); | |
var xacService = Mock.Interface<IXACService>(); | |
var app = MockApp(screenService, msgRouterService, xacService, dataService); | |
var controller = new SelectPumpController(app); | |
AssertExpectations.IsMetFor(app); | |
AssertExpectations.IsMetFor(screenService); | |
AssertExpectations.IsMetFor(msgRouterService); | |
AssertExpectations.IsMetFor(xacService); | |
AssertExpectations.IsMetFor(dataService); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment