public void TestJob() { var fixture = new JobFixture <MemoJob>(this); //BDD тест (сценарий) fixture.For() //Допустим (предусловия) .GivenNothing() //Когда (тестируемые действия) .WhenTimer() //Тогда (проверка результатов) .ThenExpect <MemoId, UpdateMemo>(command => command.Document.CustomerAddress.City == "Москва"); }
public void JobsAreNotConfiguredIfHangfireIsNotUsed() { // arrange ApplicationConfigurationHelper.AdjustKeys(ConfigurationKeys.HangfireEnabled, true.ToString()); ApplicationConfigurationHelper.AdjustKeys(ConfigurationKeys.HangfireEnableDashboard, false.ToString()); var activatorDummy = new Mock <JobActivator>(); var jobDummy = new JobFixture(); var hangfireConfigDummy = new HangfireStorageProviderFixture(); var appBuilderDummy = new AppBuilderFixture(); var sut = new HangfireConfiguration(new List <HangfireStorageConfigurationBase> { hangfireConfigDummy }, activatorDummy.Object, new List <HangfireJobBase> { jobDummy }); // act sut.SetupHangfire(appBuilderDummy); // assert jobDummy.WasSetUp.Should().BeTrue(); }
public void ShouldNotReturnJobsThatAreCompleted() { FixturesHelper.StoreFakes((job) => _database.Jobs.Insert(job), 5, JobFixture.CloneJob); FixturesHelper.StoreFakes((job) => _database.Jobs.Insert(job), 4, () => JobFixture.CloneJob().Complete(10.Days().Ago())); var result = _harness.Controller.Index() as JsonResult; var jobs = result.DeserializeData <List <Job> >(); jobs.Count.ShouldEqual(5); }