public Application Get(int id) { var applicationAccess = new ApplicationAccess(); var applicationDB = applicationAccess.Get(id); return(DBToLogic(applicationDB)); }
public static void Initialize(TestContext context) { testHelpers = new TestHelpers(); applicationAccess = new ApplicationAccess(); db = new BandItEntities(); testHelpers.ClearData(); testHelpers.InsertTestData(); }
public void Add(Application application) { var applicationAccess = new ApplicationAccess(); var applicationDB = applicationAccess.Get(application.ID); if (applicationDB == null) { applicationAccess.Add(LogicToDB(application)); } }
/// <summary> /// Создаю модель приложения и фиксирую в трекере базы /// </summary> /// <returns></returns> public static ApplicationAccess ApplicationAccessCreate() { var result = default(ApplicationAccess); DCT.DCT.Execute(c => { result = new ApplicationAccess(); result.StateEnum = ApplicationState.Enable; }); return(result); }
public static void Initialize(TestContext context) { testHelpers = new TestHelpers(); applicationController = new ApplicationController(); bandController = new BandController(); userController = new UserController(); db = new ModelsDB.BandItEntities(); applicationAccess = new ApplicationAccess(); testHelpers.ClearData(); testHelpers.InsertTestData(); }
public List <Application> Get() { var applicationAccess = new ApplicationAccess(); var applicationsDB = applicationAccess.Get(); var applicationsLogic = new List <Application>(); for (int i = 0; i < applicationsDB.Count; i++) { applicationsLogic.Add(DBToLogic(applicationsDB[i])); } return(applicationsLogic); }
public void TestCanUpdateModifiableAppType_ViaApi(bool canUpdate) { Definition entityType; UserAccount userAccount; string solutionName = "TestSolution" + Guid.NewGuid(); using (new SecurityBypassContext()) { var solution = new Solution { Name = solutionName, CanModifyApplication = true }; solution.Save(); entityType = new Definition { InSolution = solution }; entityType.Save(); userAccount = Entity.GetByField <UserAccount>(SpecialStrings.TenantAdministratorUser, false, new EntityRef("core", "name")).FirstOrDefault(); var context = RequestContext.GetContext(); ApplicationAccess.ChangeTenantApplicationCanModify(context.Tenant.Name, solutionName, canUpdate); CacheManager.ClearCaches(); } using (new SetUser(userAccount)) { // Modify the type entityType.Description = "New Description"; Assert.That(() => entityType.Save(), canUpdate ? (Constraint)Throws.Nothing : Throws.TypeOf <PlatformSecurityException>()); } }
public ApplicationController() { applicationAccess = new ApplicationAccess(); bandUserController = new BandUserController(); }