// ARM
        public async Task <ResourceGroup> ActivateLogicApp(BaseTemplate template, TryWebsitesIdentity userIdentity, string anonymousUserName)
        {
            return(await ActivateResourceGroup(userIdentity, AppService.Logic, DeploymentType.CsmDeploy, async (resourceGroup, inProgressOperation) =>
            {
                SimpleTrace.TraceInformation("{0}; {1}; {2}; {3}; {4}",
                                             AnalyticsEvents.OldUserCreatedSiteWithLanguageAndTemplateName, "Logic", template.Name, resourceGroup.ResourceUniqueId, AppService.Logic.ToString());

                var logicApp = new LogicApp(resourceGroup.SubscriptionId, resourceGroup.ResourceGroupName, Guid.NewGuid().ToString().Replace("-", ""))
                {
                    Location = resourceGroup.GeoRegion
                };

                var csmTemplateString = string.Empty;

                using (var reader = new StreamReader(((SimpleWAWS.Models.LogicTemplate)(TemplatesManager.GetTemplates().FirstOrDefault((a) => a.AppService == AppService.Logic))).CsmTemplateFilePath))
                {
                    csmTemplateString = await reader.ReadToEndAsync();
                }

                csmTemplateString = csmTemplateString.Replace("{{logicAppName}}", logicApp.LogicAppName);
                //csmTemplateString = csmTemplateString.Replace("{{gatewayName}}", Guid.NewGuid().ToString().Replace("-", "")).Replace("{{logicAppName}}", logicApp.LogicAppName);

                await inProgressOperation.CreateDeployment(JsonConvert.DeserializeObject <JToken>(csmTemplateString), block: true, subscriptionType: resourceGroup.SubscriptionType);

                // After a deployment, we have no idea what changes happened in the resource group
                // we should reload it.
                // TODO: consider reloading the resourceGroup along with the deployment itself.
                await resourceGroup.Load();

                var rbacTask = resourceGroup.AddResourceGroupRbac(userIdentity.Puid, userIdentity.Email);
                resourceGroup.IsRbacEnabled = await rbacTask;
                return resourceGroup;
            }));
        }
Esempio n. 2
0
    public void Start()
    {
        LogicApp.SP = this;

        DontDestroyOnLoad(this);

        InitGameMgr();
    }
Esempio n. 3
0
    public void Start()
    {
        LogicApp.Instance = this;
        DontDestroyOnLoad(this);
        Invoke("SetCustomCursor", 1f);
        Application.targetFrameRate = 60;
        CoroutineManager.Init(this);

        CoroutineManager.StartCoroutine(StartInit());
    }
        public void GenerateExpression_RandomExpressionGeneratedAndPassedToLogicAppForParsing_ExpectedAllHashCodesToMatch()
        {
            // Arrange
            // re-use logic app for not repeating large procedure and for all the hash codes.
            LogicApp             logicApp             = new LogicApp(new Parser());
            PropositionGenerator propositionGenerator = new PropositionGenerator();

            // Act
            Proposition randomExpression = propositionGenerator.GenerateExpression();

            logicApp.Parse(randomExpression);

            bool hashCodesMatched = logicApp.HashCodesMatched();

            // Assert
            hashCodesMatched.Should().BeTrue("Because a valid expression should be generated");
        }
Esempio n. 5
0
 public LogicAppTests()
 {
     logicApp = new LogicApp(new Parser());
 }