public void Test___Method_Reset___Status_Stopped()
        {
            var duration = new AnyVariable <int>()
            {
                Value = 1000
            };

            var testee = new ParallelActivity()
            {
                Activities = new List <IActivity>()
                {
                    new DelayActivity()
                    {
                        Duration = duration
                    },
                    new DelayActivity()
                    {
                        Duration = duration
                    }
                }
            };

            testee.Stop();

            Assert.AreEqual(ActivityStatus.Stopped, testee.Status);

            testee.Reset();

            Assert.AreEqual(ActivityStatus.Created, testee.Status);
        }
        public async Task Test___Method_Stop___Status_Executing()
        {
            var duration = new AnyVariable <int>()
            {
                Value = 1000
            };

            var testee = new ParallelActivity()
            {
                Activities = new List <IActivity>()
                {
                    new DelayActivity()
                    {
                        Duration = duration
                    },
                    new DelayActivity()
                    {
                        Duration = duration
                    }
                }
            };

            var task = testee.Start();

            Assert.AreEqual(ActivityStatus.Executing, testee.Status);

            testee.Stop();

            await task;

            Assert.AreEqual(ActivityStatus.Stopped, testee.Status);
        }
        public async Task Test___Method_Stop___Status_Suspended()
        {
            var duration = new AnyVariable <int>()
            {
                Value = 1000
            };
            var value = new AnyVariable <bool>()
            {
                Value = false
            };

            var testee = new ParallelActivity()
            {
                Activities = new List <IActivity>()
                {
                    new DelayActivity()
                    {
                        Duration = duration
                    },
                    new SuspendActivity()
                    {
                        Until = new TrueCondition()
                        {
                            Value = value
                        }
                    }
                }
            };

            await testee.Start();

            Assert.AreEqual(ActivityStatus.Suspended, testee.Status);

            testee.Stop();

            Assert.AreEqual(ActivityStatus.Stopped, testee.Status);
        }