Example #1
0
            public void Set_One_Action_Enabled_AssignDate()
            {
                IPlanElementUtils pUtils = new PlanElementUtils();
                string            modId  = ObjectId.GenerateNewId().ToString();

                AD.Program prog = new AD.Program
                {
                    Modules = new List <AD.Module>
                    {
                        new AD.Module
                        {
                            Id      = modId,
                            Actions = new List <AD.Actions>
                            {
                                new AD.Actions
                                {
                                    Enabled = true
                                },
                                new AD.Actions
                                {
                                    Enabled = false
                                }
                            }
                        }
                    }
                };

                pUtils.SetElementEnabledState(modId, prog);
                Assert.AreEqual(DateTime.UtcNow.Date, ((DateTime)prog.Modules[0].Actions[0].AssignDate).Date);
            }
Example #2
0
            public void Set_Two_Actions_Enabled_AssignTo()
            {
                IPlanElementUtils pUtils     = new PlanElementUtils();
                string            modId      = ObjectId.GenerateNewId().ToString();
                ObjectId          assingtoID = ObjectId.GenerateNewId();

                AD.Program prog = new AD.Program
                {
                    AssignToId = assingtoID.ToString(),
                    Modules    = new List <AD.Module>
                    {
                        new AD.Module
                        {
                            Id      = modId,
                            Actions = new List <AD.Actions>
                            {
                                new AD.Actions
                                {
                                    Enabled = true
                                },
                                new AD.Actions
                                {
                                    Enabled = true
                                }
                            }
                        }
                    }
                };

                pUtils.SetElementEnabledState(modId, prog);
                Assert.AreEqual(assingtoID.ToString(), prog.Modules[0].Actions[0].AssignToId);
                Assert.AreEqual(assingtoID.ToString(), prog.Modules[0].Actions[1].AssignToId);
            }
Example #3
0
            public void Set_One_Action_Enabled()
            {
                IPlanElementUtils pUtils = new PlanElementUtils();
                string            modId  = ObjectId.GenerateNewId().ToString();

                AD.Program prog = new AD.Program
                {
                    Modules = new List <AD.Module>
                    {
                        new AD.Module
                        {
                            Id      = modId,
                            Actions = new List <AD.Actions>
                            {
                                new AD.Actions
                                {
                                    Enabled = true
                                },
                                new AD.Actions
                                {
                                    Enabled = false
                                }
                            }
                        }
                    }
                };

                pUtils.SetElementEnabledState(modId, prog);
                Assert.IsNotNull(prog.Modules[0].Actions[0].AssignById);
            }