Beispiel #1
0
        public void Can_be_configured_to_schedule_activity_with_timeouts()
        {
            var activityItem = new ActivityItem(_activityIdentity, _workflow.Object);

            activityItem.WithTimeouts(
                a =>
                new ActivityTimeouts()
            {
                HeartbeatTimeout       = TimeSpan.FromSeconds(2),
                ScheduleToCloseTimeout = TimeSpan.FromSeconds(3),
                ScheduleToStartTimeout = TimeSpan.FromSeconds(4),
                StartToCloseTimeout    = TimeSpan.FromSeconds(5)
            });
            var decision = ScheduleDecision(activityItem);

            Assert.That(decision.Timeouts.HeartbeatTimeout, Is.EqualTo(TimeSpan.FromSeconds(2)));
            Assert.That(decision.Timeouts.ScheduleToCloseTimeout, Is.EqualTo(TimeSpan.FromSeconds(3)));
            Assert.That(decision.Timeouts.ScheduleToStartTimeout, Is.EqualTo(TimeSpan.FromSeconds(4)));
            Assert.That(decision.Timeouts.StartToCloseTimeout, Is.EqualTo(TimeSpan.FromSeconds(5)));
        }