public UnitTestBase() { this.orgAdminUIService = crm.GetAdminService(new MockupServiceSettings(true, false, MockupServiceSettings.Role.UI)); this.orgGodService = crm.GetAdminService(new MockupServiceSettings(false, true, MockupServiceSettings.Role.SDK)); this.orgAdminService = crm.GetAdminService(); this.orgRealDataService = crmRealData.GetAdminService(); }
public UnitTestBase() { orgAdminUIService = crm.GetAdminService(new MockupServiceSettings(true, false, MockupServiceSettings.Role.UI)); orgGodService = crm.GetAdminService(new MockupServiceSettings(false, true, MockupServiceSettings.Role.SDK)); orgAdminService = crm.GetAdminService(); if (crmRealData != null) { orgRealDataService = crmRealData.GetAdminService(); } //create an admin user for our impersonating user plugin to run as var adminId = Guid.Parse("84a23551-017a-44fa-9cc1-08ee14bb97e8"); var admin = new Entity("systemuser"); admin.Id = adminId; admin["internalemailaddress"] = "*****@*****.**"; admin["businessunitid"] = crm.RootBusinessUnit; admin["islicensed"] = true; // crm.CreateUser var adminRole = crm.GetSecurityRole("System Administrator"); var adminUser = crm.CreateUser(orgAdminService, admin, new Guid[] { adminRole.RoleId }); InitialiseAccessTeamConfiguration(); }
public UnitTestBaseNoReset(XrmMockupFixture fixture) { crm = fixture.crm; orgAdminUIService = crm.GetAdminService(new MockupServiceSettings(true, false, MockupServiceSettings.Role.UI)); orgGodService = crm.GetAdminService(new MockupServiceSettings(false, true, MockupServiceSettings.Role.SDK)); orgAdminService = crm.GetAdminService(); if (fixture.crmRealData != null) { orgRealDataService = fixture.crmRealData.GetAdminService(); } //create an admin user to run our impersonating user plugins as var userQuery = new QueryExpression("systemuser"); userQuery.Criteria.AddCondition("systemuserid", ConditionOperator.Equal, Guid.Parse("3b961284-cd7a-4fa3-af7e-89802e88dd5c")); var users = orgAdminService.RetrieveMultiple(userQuery); if (users.Entities.SingleOrDefault() == null) { var adminUser = new Entity("systemuser") { Id = Guid.Parse("3b961284-cd7a-4fa3-af7e-89802e88dd5c") }; adminUser["businessunitid"] = crm.RootBusinessUnit; adminUser = crm.CreateUser(orgAdminService, adminUser, SecurityRoles.SystemAdministrator); } }
public UnitTestBase(XrmMockupFixture fixture) { crm = fixture.crm; crm.ResetEnvironment(); orgAdminUIService = crm.GetAdminService(new MockupServiceSettings(true, false, MockupServiceSettings.Role.UI)); orgGodService = crm.GetAdminService(new MockupServiceSettings(false, true, MockupServiceSettings.Role.SDK)); orgAdminService = crm.GetAdminService(); if (fixture.crmRealData != null) { orgRealDataService = fixture.crmRealData.GetAdminService(); } //create an admin user to run our impersonating user plugins as var adminUser = new Entity("systemuser") { Id = Guid.Parse("3b961284-cd7a-4fa3-af7e-89802e88dd5c") }; adminUser["businessunitid"] = crm.RootBusinessUnit; adminUser["internalemailaddress"] = "*****@*****.**"; adminUser["islicensed"] = true; adminUser = crm.CreateUser(orgAdminService, adminUser, SecurityRoles.SystemAdministrator); InitialiseAccessTeamConfiguration(); }
public UnitTestBaseNoProxyTypes(XrmMockupFixtureNoProxyTypes fixture) { crm = fixture.crm; crm.ResetEnvironment(); orgAdminUIService = crm.GetAdminService(new MockupServiceSettings(true, false, MockupServiceSettings.Role.UI)); orgGodService = crm.GetAdminService(new MockupServiceSettings(false, true, MockupServiceSettings.Role.SDK)); orgAdminService = crm.GetAdminService(); if (fixture.crmRealData != null) { orgRealDataService = fixture.crmRealData.GetAdminService(); } }