Esempio n. 1
0
            public void Get_Assigned_Date()
            {
                DateTime          control = DateTime.UtcNow.Date;
                IPlanElementUtils peUtil  = new PlanElementUtils {
                };

                AD.Module  mod  = new AD.Module();
                AD.Program prog = new AD.Program();

                peUtil.SetInitialProperties("123456789012345678901234", mod, false);

                Assert.AreEqual(DateTime.UtcNow.Date, ((DateTime)mod.AssignDate).Date);
            }
Esempio n. 2
0
            public void Set_Assigned_Date_Null()
            {
                string            assignedTO = null;
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };

                AD.Module  mod  = new AD.Module();
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO
                };

                peUtil.SetInitialProperties(assignedTO, mod, false);

                Assert.AreEqual(DateTime.UtcNow.Date, ((DateTime)mod.AssignDate).Date);
            }
Esempio n. 3
0
            public void Get_Assigned_To_Null()
            {
                string            assignedTO = null;
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };

                AD.Module  mod  = new AD.Module();
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO
                };

                peUtil.SetInitialProperties(assignedTO, mod, false);

                Assert.AreEqual(assignedTO, mod.AssignToId);
            }
Esempio n. 4
0
            public void Get_Assigned_To()
            {
                ObjectId?         assignedTO = new ObjectId();
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };

                AD.Module  mod  = new AD.Module();
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO.ToString()
                };

                peUtil.SetInitialProperties(assignedTO.ToString(), mod, false);

                Assert.AreEqual(assignedTO.ToString(), mod.AssignToId);
            }
Esempio n. 5
0
            public void Set_One_Action_Assign_Date()
            {
                IPlanElementUtils pUtils = new PlanElementUtils();

                AD.Module mod = new AD.Module
                {
                    Enabled = true,
                    Actions = new List <AD.Actions>
                    {
                        new AD.Actions {
                            Enabled = true
                        },
                        new AD.Actions {
                            Enabled = false
                        }
                    }
                };

                pUtils.SetInitialActions(mod, "123456789012345678901234");

                Assert.AreEqual(DateTime.UtcNow.Date, ((DateTime)mod.Actions[0].AssignDate).Date);
            }
Esempio n. 6
0
            public void Set_One_Action()
            {
                IPlanElementUtils pUtils = new PlanElementUtils();

                AD.Module mod = new AD.Module
                {
                    Enabled = true,
                    Actions = new List <AD.Actions>
                    {
                        new AD.Actions {
                            Enabled = true
                        },
                        new AD.Actions {
                            Enabled = false
                        }
                    }
                };

                pUtils.SetInitialActions(mod, "123456789012345678901234");

                Assert.IsNotNull(mod.Actions[0].AssignById);
            }
Esempio n. 7
0
            public void Set_One_Action_With_State_InProgress()
            {
                IPlanElementUtils pUtils = new PlanElementUtils();

                AD.Module mod = new AD.Module
                {
                    Enabled = true,
                    Actions = new List <AD.Actions>
                    {
                        new AD.Actions {
                            Enabled = true, ElementState = 4
                        },                                                 // inprogress
                        new AD.Actions {
                            Enabled = true, ElementState = 2
                        }                                                 // not started
                    }
                };

                pUtils.SetInitialActions(mod, "123456789012345678901234");

                Assert.IsNotNull(mod.Actions[1].AssignById);
            }