Ejemplo n.º 1
0
            public void SetProgramAttributes_DoNot_Set_Program_State_state_1()
            {
                IPlanElementUtils pUtils = new PlanElementUtils {
                    ProgramAttributeStrategy = new ProgramAttributeStrategy()
                };
                var pe = new AD.PlanElement {
                    Enabled = false
                };
                var progAttr = new ProgramAttributeData();
                var prog     = new AD.Program {
                    Name = "test"
                };

                pUtils.SetProgramAttributes(new AD.SpawnElement {
                    Tag = "1", ElementType = 10, ElementId = "1234"
                }, prog, "user", progAttr);

                Assert.AreEqual(0, prog.ElementState);
            }
Ejemplo n.º 2
0
 public void SetProgramAttributes_Null_attributes()
 {
     try
     {
         IPlanElementUtils pUtils = new PlanElementUtils();
         AD.PlanElement    pe     = new AD.PlanElement {
             Enabled = false
         };
         pUtils.SetProgramAttributes(new AD.SpawnElement {
             Tag = "0", ElementType = 19, ElementId = "1234"
         },
                                     new AD.Program {
             Name = "test"
         }, "user", null);
     }
     catch (Exception ex)
     {
         Assert.IsTrue(ex != null);
     }
 }
Ejemplo n.º 3
0
            public void Set_Element_State_Change_Date()
            {
                IPlanElementUtils peUtil = new PlanElementUtils {
                };

                AD.SpawnElement spwn = new AD.SpawnElement
                {
                    ElementId   = "123456789012345678901234",
                    ElementType = 12,
                    Tag         = "3"
                };
                AD.Program program = new AD.Program {
                    ElementState = 1
                };
                ProgramAttributeData progAttr = new ProgramAttributeData();

                peUtil.SetProgramAttributes(spwn, program, "UserId", progAttr);

                DateTime control = DateTime.UtcNow.Date;
                DateTime sample  = ((DateTime)program.StateUpdatedOn).Date;

                Assert.AreEqual(control, sample);
            }