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); }
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); }
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); }
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); }
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); }
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); }
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); }