예제 #1
0
 private void StatusTest()
 {
     /*
      * Status field
      * */
     //Valid values
     Assert.IsTrue(
         XrmEntity.GetOptionSetValue(XrmService.ParseField(Fields.jmcg_testentity_.statuscode, Entities.jmcg_testentity, "Active")) ==
         OptionSets.TestEntity.StatusReason.Active);
     Assert.IsTrue(
         XrmEntity.GetOptionSetValue(XrmService.ParseField(Fields.jmcg_testentity_.statuscode, Entities.jmcg_testentity,
                                                           OptionSets.TestEntity.StatusReason.Active)) ==
         OptionSets.TestEntity.StatusReason.Active);
     Assert.IsTrue(
         XrmEntity.GetOptionSetValue(XrmService.ParseField(Fields.jmcg_testentity_.statuscode, Entities.jmcg_testentity,
                                                           XrmEntity.CreateOptionSet(OptionSets.TestEntity.StatusReason.Active))) ==
         OptionSets.TestEntity.StatusReason.Active);
     try
     {
         var blah = XrmService.ParseField(Fields.jmcg_testentity_.statuscode, Entities.jmcg_testentity, "NOTASTATUS");
         Assert.Fail();
     }
     catch (Exception ex)
     {
         CheckException(ex);
     }
 }
예제 #2
0
 private void StatusTest()
 {
     /*
      * Status field
      * */
     //Valid values
     Assert.IsTrue(
         XrmEntity.GetOptionSetValue(XrmService.ParseField("statuscode", Entities.jmcg_testentity, "Active")) ==
         TestEntityConstants.Statusses.TestStatus);
     Assert.IsTrue(
         XrmEntity.GetOptionSetValue(XrmService.ParseField("statuscode", Entities.jmcg_testentity,
                                                           TestEntityConstants.Statusses.TestStatus)) ==
         TestEntityConstants.Statusses.TestStatus);
     Assert.IsTrue(
         XrmEntity.GetOptionSetValue(XrmService.ParseField("statuscode", Entities.jmcg_testentity,
                                                           XrmEntity.CreateOptionSet(
                                                               TestEntityConstants.Statusses.TestStatus))) ==
         TestEntityConstants.Statusses.TestStatus);
     try
     {
         var blah = XrmService.ParseField("statuscode", Entities.jmcg_testentity, "NOTASTATUS");
         Assert.Fail();
     }
     catch (Exception ex)
     {
         CheckException(ex);
     }
 }