Esempio n. 1
0
        public void Test___Method_Reset___Status_Stopped()
        {
            var to = new AnyVariable <int>()
            {
                Value = 0
            };

            var testee = new IfActivity()
            {
                Condition = new TrueCondition(),
                Then      = new AssignActivity()
                {
                    To = to, Value = new AnyVariable <int>()
                    {
                        Value = 1
                    }
                },
                Else = new AssignActivity()
                {
                    To = to, Value = new AnyVariable <int>()
                    {
                        Value = 2
                    }
                }
            };

            testee.Stop();

            Assert.AreEqual(ActivityStatus.Stopped, testee.Status);
            Assert.AreEqual(0, to.GetValueAsObject());

            testee.Reset();

            Assert.AreEqual(ActivityStatus.Created, testee.Status);
        }
Esempio n. 2
0
        public async Task Test___Method_Reset___Status_Completed()
        {
            var to = new AnyVariable <int>()
            {
                Value = 0
            };

            var testee = new IfActivity()
            {
                Condition = new TrueCondition(),
                Then      = new AssignActivity()
                {
                    To = to, Value = new AnyVariable <int>()
                    {
                        Value = 1
                    }
                },
                Else = new AssignActivity()
                {
                    To = to, Value = new AnyVariable <int>()
                    {
                        Value = 2
                    }
                }
            };

            await testee.Start();

            Assert.AreEqual(ActivityStatus.Completed, testee.Status);
            Assert.AreEqual(1, to.GetValueAsObject());

            testee.Reset();

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