예제 #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_Assigned_To_No_CM_Assigned_In_Program()
            {
                string            assignedTO = null;
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };
                DateTime assigned            = DateTime.UtcNow;

                AD.Actions act = new AD.Actions {
                    AssignDate = assigned
                };
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO
                };

                peUtil.SetInitialProperties(assignedTO, act, false);

                Assert.IsNull(act.AssignToId);
            }
예제 #6
0
            public void Set_AssignedTo_CM_Already_Assigned_In_Program()
            {
                string            assignedTO = ObjectId.GenerateNewId().ToString();
                IPlanElementUtils peUtil     = new PlanElementUtils {
                };
                DateTime assigned            = DateTime.UtcNow;

                AD.Actions act = new AD.Actions {
                    AssignDate = assigned
                };
                AD.Program prog = new AD.Program {
                    AssignToId = assignedTO
                };

                peUtil.SetInitialProperties(assignedTO, act, false);

                Assert.AreEqual(assignedTO, act.AssignToId);
            }
예제 #7
0
            public void Set_Assigned_Date_Already_Assigned()
            {
                string            assignedDate = null;
                IPlanElementUtils peUtil       = new PlanElementUtils {
                };
                DateTime assigned = DateTime.UtcNow;

                AD.Actions act = new AD.Actions {
                    AssignDate = assigned
                };
                AD.Program prog = new AD.Program {
                    AssignToId = assignedDate
                };

                peUtil.SetInitialProperties(assignedDate, act, false);

                Assert.AreEqual(assigned.Date, ((DateTime)act.AssignDate).Date);
            }