示例#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);
            }
示例#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);
            }
示例#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);
            }
示例#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);
            }
示例#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);
            }
示例#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);
            }
示例#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);
            }