public void Initialize() { var mocker = new AutoMocker(); _folderServiceMock = mocker.GetMock <IFolderService>(); _testCaseServiceMock = mocker.GetMock <ITestCaseService>(); _controller = new TestCaseController(_testCaseServiceMock.Object); }
public TestCaseControllerUnitTests() { var serviceProvider = new ServiceCollection() .AddLogging() .BuildServiceProvider(); var factory = serviceProvider.GetService <ILoggerFactory>(); _logger = factory.CreateLogger <TestCaseController>(); _serviceTest = new TestcaseServiceFake(); _serviceFolder = new FolderServiceFake(); _controller = new TestCaseController(_serviceTest, _serviceFolder, _logger); }
public TestCaseControllerTest() { this.testCase = new TestCase(); this.testCaseRepository = Mock.Of <ITestCaseRepository>(r => r.Get(It.IsAny <string>()) == testCase); this.controller = new TestCaseController(testCaseRepository); }