public void Init_Timers_only_registers_once()
        {
            for (int i = 0; i < 2; i++)
            {
                var fakeTimer = new FakeJob();
                IEnumerable <IJob> BaseFakeJobs = new List <IJob> {
                    fakeTimer
                };

                Mocker.SetConstant(BaseFakeJobs);

                var jobProvider = Mocker.Resolve <JobProvider>();
                jobProvider.Initialize();
            }

            var Mocker2 = new AutoMoqer();

            Mocker2.SetConstant(Db);
            var assertjobProvider = Mocker2.Resolve <JobProvider>();
            var timers            = assertjobProvider.All();

            //Assert
            timers.Should().HaveCount(1);
            timers[0].Enable.Should().BeTrue();
        }
예제 #2
0
 public void Setup()
 {
     WithRealDb();
     fakeJob = new FakeJob();
     slowJob = new SlowJob();
     brokenJob = new BrokenJob();
     disabledJob = new DisabledJob();
 }
 public void Setup()
 {
     WithRealDb();
     fakeJob     = new FakeJob();
     slowJob     = new SlowJob();
     brokenJob   = new BrokenJob();
     disabledJob = new DisabledJob();
 }
예제 #4
0
        public void Init_Timers_only_registers_once()
        {
            for (int i = 0; i < 2; i++)
            {
                var fakeTimer = new FakeJob();
                IList<IJob> BaseFakeJobs = new List<IJob> { fakeTimer };

                Mocker.SetConstant(BaseFakeJobs);

                var jobProvider = Mocker.Resolve<JobProvider>();
                jobProvider.Initialize();
            }

            var Mocker2 = new AutoMoqer();

            Mocker2.SetConstant(Db);
            var assertjobProvider = Mocker2.Resolve<JobProvider>();
            var timers = assertjobProvider.All();

            //Assert
            timers.Should().HaveCount(1);
            timers[0].Enable.Should().BeTrue();
        }