public void AutonumberConfigurationPluginActiveInactiveTest() { const string type = "account"; const string field = "accountnumber"; foreach (var entityType in EntitiesToDelete) { DeleteAll(entityType); } DeleteAutonumbersAndRegistrations(type); var autonumberEntity = CreateAutonumber(type, field, "AC", "-", 8); var account = CreateAccount(); Assert.IsFalse(account.GetStringField("accountnumber").IsNullOrWhiteSpace()); XrmService.Deactivate(autonumberEntity); account = CreateAccount(); Assert.IsTrue(account.GetStringField("accountnumber").IsNullOrWhiteSpace()); XrmService.Activate(autonumberEntity); account = CreateAccount(); Assert.IsFalse(account.GetStringField("accountnumber").IsNullOrWhiteSpace()); }
public void AutonumberConfigurationCreateRegistrationsTest() { const string type = "account"; const string field = "accountnumber"; foreach (var entityType in EntitiesToDelete) { DeleteAll(entityType); } DeleteAutonumbersAndRegistrations(type); var autonumber = CreateAutonumber(type, field, "AC", "-", 8); var registration = AutonumberService.GetExistingRegistration(type); Assert.IsNotNull(registration); XrmService.Deactivate(autonumber); registration = AutonumberService.GetExistingRegistration(type); Assert.IsNull(registration); XrmService.Activate(autonumber); registration = AutonumberService.GetExistingRegistration(type); Assert.IsNotNull(registration); XrmService.Delete(autonumber); registration = AutonumberService.GetExistingRegistration(type); Assert.IsNull(registration); }