public void Initialize()
        {
            var mocker = new AutoMocker();

            _folderServiceMock   = mocker.GetMock <IFolderService>();
            _testCaseServiceMock = mocker.GetMock <ITestCaseService>();
            _controller          = new TestCaseController(_testCaseServiceMock.Object);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public TestCaseControllerTest()
 {
     this.testCase           = new TestCase();
     this.testCaseRepository = Mock.Of <ITestCaseRepository>(r => r.Get(It.IsAny <string>()) == testCase);
     this.controller         = new TestCaseController(testCaseRepository);
 }