Esempio n. 1
0
        public void 集成測試()
        {
            var job    = new DemoJob();
            var client = new BackgroundJobClient();

            job.JobClient = client;
            job.EnqueueAction();
            Thread.Sleep(5000);
        }
Esempio n. 2
0
        public void 驗證有呼叫Create方法()
        {
            //arrange
            var client  = Substitute.For <IBackgroundJobClient>();
            var demoJob = new DemoJob(client);

            //act
            demoJob.EnqueueAction();

            //assert
            client.Received()
            .Create(Arg.Is <Job>(p => p.Method.Name == "Action"),
                    Arg.Is <EnqueuedState>(p => p.Name == "Enqueued"));
        }
Esempio n. 3
0
        public void 列舉被測目標目與相依物件互動的參數()
        {
            var client  = Substitute.For <IBackgroundJobClient>();
            var demoJob = new DemoJob(client);

            demoJob.EnqueueAction();

            var calls = client.ReceivedCalls();

            foreach (var call in calls)
            {
                var arguments = call.GetArguments();
            }
        }