public void BeforeTest()
 {
     _hotelSystemDouble  = A.Fake <HotelSystem>();
     _stepFactoryDouble  = A.Fake <StepFactory>();
     _stepExecutorDouble = A.Fake <StepsExecutor>();
     _subject            = new ReserveHotelUsecase(_hotelSystemDouble, _stepFactoryDouble, _stepExecutorDouble);
 }
예제 #2
0
 public void CreateUploadDwonloadDirectory()
 {
     CleanupCreatedDirectoriesSafely();
     StepsExecutor.ExecuteSafely(() => Directory.Delete(GetDownloadPath(), true));
     StepsExecutor.ExecuteSafely(() => Directory.Delete(GetUploadPath(), true));
     CleanupCreatedDirectoriesSafely();
 }
 public UseCaseFactory()
 {
     _hotelSystem  = new HotelSystem();
     _stepFactory  = new StepFactory();
     _stepExecutor = new StepsExecutor();
     _systemInit   = new SystemInit();
     _systemInit.AddHotels(_hotelSystem);
 }
        public void Setup_VerificarSolicitacoesNaoConcluidas()
        {
            StepsExecutor = new StepsExecutor();
            StepsExecutor.ConfigureConnectionsForWorkDispatcher();
            StepsExecutor.InstantiateWorkDispatcher();

            StepsExecutor.InstantiateDummyJobAndConfigureSubscriptionOnWorkDispatcher();
            StepsExecutor.InitializeWorkDispatcher();
        }
예제 #5
0
        public void Setup()
        {
            testAssembly  = Assembly.GetExecutingAssembly();
            testCase      = new TestCase("Feature.Scenario", TestExecutor.ExecutorUriStronglyTyped, "SourceAssembly");
            stepsExecutor = new StepsExecutor(mockStepBinder.Object);

            testRunContext = new TestRunContext(
                new DefaultServiceProvider(),
                new Mock <ITestLogAccessor>().Object);

            testRunContext.EventualSuccess.DelayBetweenAttempts = TimeSpan.FromMilliseconds(250);
        }
 public void AfterWebDriverSetupSetps()
 {
     if (Directory.Exists(appConfigMember.RootDownloadLocation))
     {
         StepsExecutor.ExecuteSafely(() => Directory.Delete(appConfigMember.RootDownloadLocation, true));
         StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(appConfigMember.RootDownloadLocation));
     }
     if (Directory.Exists(appConfigMember.RootUploadLocation))
     {
         StepsExecutor.ExecuteSafely(() => Directory.Delete(appConfigMember.RootUploadLocation, true));
         StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(appConfigMember.RootUploadLocation));
     }
 }
 public void AfterWebDriverSetupSetps()
 {
     if (!Directory.Exists(appConfigMember.RootDownloadLocation))
     {
         StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(appConfigMember.RootDownloadLocation));
     }
     if (!Directory.Exists(appConfigMember.RootUploadLocation))
     {
         StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(appConfigMember.RootUploadLocation));
     }
     if (!Directory.Exists(appConfigMember.ChromeLogFileLocation))
     {
         StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(Path.GetDirectoryName(appConfigMember.ChromeLogFileLocation)));
     }
 }
예제 #8
0
        private async Task RunMappedTest(TestCase testCase, DiscoveredTestData testData, TestRunContext testRunContext, StepBinder stepBinder, IFrameworkHandle frameworkHandle)
        {
            frameworkHandle.SendMessage(TestMessageLevel.Informational, $"Starting test \"{testCase.DisplayName}\"");

            frameworkHandle.RecordStart(testCase);

            var executor = new StepsExecutor(stepBinder);

            // Deliberately resume on same context to try to avoid Visual Studio Test Explorer "bug" (?) that doesn't
            // always detect the end of the test run when multiple tests are run in parallel.
            var testResult = await executor
                             .Execute(testCase, testData, testRunContext, frameworkHandle)
                             .ConfigureAwait(true);

            // https://github.com/Microsoft/vstest/blob/master/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/TestExecutionRecorder.cs <- comments here seem to suggest that we need to call RecordEnd just before RecordResult
            frameworkHandle.RecordEnd(testCase, testResult.Outcome);
            frameworkHandle.RecordResult(testResult);

            frameworkHandle.SendMessage(TestMessageLevel.Informational, $"Finished test \"{testCase.DisplayName}\"");
        }
 public void Setup()
 {
     StepsExecutor = new StepsExecutor();
     StepsExecutor.InitializeDependencyResolverContainer();
     StepsExecutor.InstantiateDomainEventsDispatcher();
 }
예제 #10
0
 public void BeforeTest()
 {
     _subject     = new StepsExecutor();
     _stepsInputs = new List <StepInput>();
 }
 public void TearDown()
 {
     StepsExecutor.Dispose();
     StepsExecutor = null;
 }
 protected void ExecuteSafely(Action steps)
 {
     StepsExecutor.ExecuteSafely(steps);
 }
 public void Setup()
 {
     StepsExecutor = StepsExecutor ?? new StepsExecutor();
 }
 public void Setup_ConfigurarRecebimentoDeSolicitacoesDeTrabalhoPendentes()
 {
     StepsExecutor = StepsExecutor ?? new StepsExecutor();
     StepsExecutor.ConfigureConnectionsForWorkDispatcher();
     StepsExecutor.InstantiateWorkDispatcher();
 }
예제 #15
0
 internal ReserveHotelUsecase(HotelSystem hotelSystem, StepFactory stepFactory, StepsExecutor stepExecutor)
 {
     _hotelSystem  = hotelSystem;
     _stepFactory  = stepFactory;
     _stepExecutor = stepExecutor;
 }
예제 #16
0
 public void CleanupCreatedDirectoriesSafely()
 {
     StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(GetDownloadPath()));
     StepsExecutor.ExecuteSafely(() => Directory.CreateDirectory(GetUploadPath()));
 }