Esempio n. 1
0
        protected override void RunSetUpAmls()
        {
            woodPropertyValue = TestData.Get(nameof(woodPropertyValue));
            chairNumberLabel  = TestData.Get(nameof(chairNumberLabel));
            dateCreatedLabel  = TestData.Get(nameof(dateCreatedLabel));
            paintColorLabel   = TestData.Get(nameof(paintColorLabel));
            typeOfWoodLabel   = TestData.Get(nameof(typeOfWoodLabel));
            redColorValue     = TestData.Get("redLabel");
            blueColorValue    = TestData.Get("blueLabel");
            greenColorValue   = TestData.Get("greenLabel");

            replacementMap.Add("{userAliasId1}", Actor.ActorInfo.AliasId);
            replacementMap.Add("{dateToday}", DateTime.Today.ToShortInnovatorDateTimeString(Settings.CultureInfo));
            replacementMap.Add("{dateToday+3}", DateTime.Today.AddDays(3).ToShortInnovatorDateTimeString(Settings.CultureInfo));
            replacementMap.Add("{woodPropertyValue}", woodPropertyValue);
            replacementMap.Add("{redLabel}", redColorValue);
            replacementMap.Add("{blueLabel}", blueColorValue);
            replacementMap.Add("{greenLabel}", greenColorValue);
            replacementMap.Add("{chairNumberLabel}", chairNumberLabel);
            replacementMap.Add("{dateCreatedLabel}", dateCreatedLabel);
            replacementMap.Add("{paintColorLabel}", paintColorLabel);
            replacementMap.Add("{typeOfWoodLabel}", typeOfWoodLabel);
            replacementMap.Add("{LocaleLabel}", TestData.Get("LocaleLabel"));
            SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(amlSetupPath, replacementMap));
            SystemActor.AttemptsTo(Apply.Aml.WithPermissions(Actor.ActorInfo).FromParameterizedFile(amlItemsPath, replacementMap));
        }
        protected override void RunTearDownAmls()
        {
            SystemActor.AttemptsTo(Apply.Aml.WithPermissions(UserType.Root).FromParameterizedFile(AmlPath + AmlCleanupName, replacementMap));

            Actor2.ActorInfo.ManagerId = null;
            SystemActor.AttemptsTo(Update.UserAndIdentityInfo.To(Actor2.ActorInfo));
        }
Esempio n. 3
0
        protected override void RunSetUpAmls()
        {
            replacementMap.Add("{userAliasId1}", Actor.ActorInfo.AliasId);
            cellValue       = TestData.Get("mapleTypeValue");
            oakTypeValue    = TestData.Get("oakTypeValue");
            birchTypeValue  = TestData.Get("birchTypeValue");
            redColorValue   = TestData.Get("redLabel");
            blueColorValue  = TestData.Get("blueLabel");
            greenColorValue = TestData.Get("greenLabel");
            sequencePadWith = TestData.Get("sequencePadWith");

            replacementMap.Add("{oakTypeValue}", oakTypeValue);
            replacementMap.Add("{mapleTypeValue}", cellValue);
            replacementMap.Add("{birchTypeValue}", birchTypeValue);
            replacementMap.Add("{redLabel}", redColorValue);
            replacementMap.Add("{blueLabel}", blueColorValue);
            replacementMap.Add("{greenLabel}", greenColorValue);
            replacementMap.Add("{sequencePadWith}", sequencePadWith);

            var propertiesInExpectedOrder = TestData.Get <Dictionary <string, string> >("PropertiesInExpectedOrder");

            foreach (var property in propertiesInExpectedOrder)
            {
                replacementMap.Add(FormattableString.Invariant($"{{{property.Key}}}"), property.Value);
            }

            replacementMap.Add("{LocaleLabel}", TestData.Get("LocaleLabel"));

            SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(
                                       Path.Combine(dataContainer, "S_1_012_Setup.xml"),
                                       replacementMap)
                                   );
        }
        protected override void InitActor()
        {
            Actor = SystemActor.AttemptsTo(Create.Actor(UserType.RegularUser));

            var userCarpenter = TestData.Get <UserInfo>("FirstUserInfo");
            var userWoods     = TestData.Get <UserInfo>("SecondUserInfo");

            Actor.ActorInfo.FirstName = userCarpenter.FirstName;
            Actor.ActorInfo.LastName  = userCarpenter.LastName;
            Actor.ActorInfo.LoginName = userCarpenter.LoginName;

            Actor.AttemptsTo(Update.UserAndIdentityInfo.To(Actor.ActorInfo));

            replacementMap.Add("{userAliasId1}", Actor.ActorInfo.AliasId);

            Actor2 = SystemActor.AttemptsTo(Create.Actor(UserType.RegularUser));
            replacementMap.Add("{userAliasId2}", Actor2.ActorInfo.AliasId);

            Actor2.ActorInfo.ManagerId = Actor.ActorInfo.Id;

            Actor2.ActorInfo.FirstName = userWoods.FirstName;
            Actor2.ActorInfo.LastName  = userWoods.LastName;
            Actor2.ActorInfo.LoginName = userWoods.LoginName;

            Actor.AttemptsTo(Update.UserAndIdentityInfo.To(Actor2.ActorInfo));
        }
        protected override void RunSetUpAmls()
        {
            SystemActor.AttemptsTo(
                Apply.Aml.FromFile(Path.Combine(TestDataFolder, "Login_CleanUp.xml")));

            SystemActor.AttemptsTo(Apply.Aml.FromFile(Path.Combine(TestDataFolder, "Login_SetUp.xml")));
        }
        protected override void RunSetUpAmls()
        {
            localeLabel            = TestData.Get(nameof(localeLabel));
            woodPropertyValue      = TestData.Get(nameof(woodPropertyValue));
            chairNumberLabel       = TestData.Get(nameof(chairNumberLabel));
            dateCreatedLabel       = TestData.Get(nameof(dateCreatedLabel));
            paintColorLabel        = TestData.Get(nameof(paintColorLabel));
            typeOfWoodLabel        = TestData.Get(nameof(typeOfWoodLabel));
            confirmPathLabel       = TestData.Get(nameof(confirmPathLabel));
            planningActivityLabel  = TestData.Get(nameof(planningActivityLabel));
            confirmingActivityName = TestData.Get(nameof(confirmingActivityName));
            confirmPathName        = TestData.Get(nameof(confirmPathName));
            finishVote             = TestData.Get(nameof(finishVote));

            replacementMap.Add("{woodPropertyValue}", woodPropertyValue);
            replacementMap.Add("{chairNumberLabel}", chairNumberLabel);
            replacementMap.Add("{dateCreatedLabel}", dateCreatedLabel);
            replacementMap.Add("{paintColorLabel}", paintColorLabel);
            replacementMap.Add("{typeOfWoodLabel}", typeOfWoodLabel);
            replacementMap.Add("{confirmPathLabel}", confirmPathLabel);
            replacementMap.Add("{planningActivityLabel}", planningActivityLabel);
            replacementMap.Add("{confirmingActivityName}", confirmingActivityName);
            replacementMap.Add("{confirmPathName}", confirmPathName);
            replacementMap.Add("{finishVote}", finishVote);
            replacementMap.Add("{LocaleLabel}", localeLabel);

            SystemActor.AttemptsTo(
                Apply.Aml.FromParameterizedFile(Path.Combine(dataContainer, AmlSetupName), replacementMap));

            replacementMap.Add("{todayDate}", DateTime.Today.ToShortInnovatorDateTimeString(Settings.CultureInfo));

            SystemActor.AttemptsTo(
                Apply.Aml.FromParameterizedFile(Path.Combine(dataContainer, AmlInstanceSetupName), replacementMap));
        }
Esempio n. 7
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime)
        {
            lifetime.ApplicationStarted.Register(() => SystemActor.ApplicationStarted(app));

            lifetime.ApplicationStopping.Register(() => SystemActor.ApplicationStopping(app));

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseStaticFiles();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapBlazorHub();
                endpoints.MapHub <PlayerHub>("/playerhub");
                endpoints.MapFallbackToPage("/_Host");
            });
        }
Esempio n. 8
0
        protected override void InitActor()
        {
            Actor = SystemActor.AttemptsTo(Create.Actor(UserType.Admin));

            replacementMap = new Dictionary <string, string>
            {
                ["{ShopWorkersForLCMPermissions}"] = TestData.Get("ShopWorkersForLCMPermissions")
            };
        }
Esempio n. 9
0
        protected override void RunSetUpAmls()
        {
            shopWorkersPermissionName = TestData.Get("ShopWorkerPermissionName");
            lcmPermissionName         = TestData.Get("LcmPermissionName");

            replacementMap.Add("{shopWorkerPermissionName}", shopWorkersPermissionName);
            replacementMap.Add("{lcmPermissionName}", lcmPermissionName);

            SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(amlSetupPath, replacementMap));
        }
Esempio n. 10
0
        protected override void RunTearDownAmls()
        {
            SystemActor.AttemptsTo(
                Apply.Aml.FromParameterizedFile(Path.Combine(AmlFolderPath, CleanupAmlName), replacementMap));

            var deleteFileAml = FormattableString.Invariant(
                $"<AML><Item type= \"File\" action = \"delete\" where = \"[FILE].created_by_id='{Actor.ActorInfo.Id}'\" /></AML>");

            SystemActor.AttemptsTo(Apply.Aml.FromString(deleteFileAml));

            SystemActor.AttemptsTo(Delete.File(uploadFilePath));
        }
Esempio n. 11
0
 protected override void InitActor()
 {
     Actor          = SystemActor.AttemptsTo(Create.Actor(UserType.Admin));
     replacementMap = new Dictionary <string, string>
     {
         ["{JaneFirstName}"] = TestData.Get("JaneFirstName"),
         ["{JoeFirstName}"]  = TestData.Get("JoeFirstName"),
         ["{JaneLastName}"]  = TestData.Get("JaneLastName"),
         ["{JoeLastName}"]   = TestData.Get("JoeLastName"),
         ["{nameValue}"]     = TestData.Get("NameValue")
     };
 }
Esempio n. 12
0
 protected override void RunSetUpAmls()
 {
     oakTypeValue   = TestData.Get("oakTypeValue");
     birchTypeValue = TestData.Get("birchTypeValue");
     mapleTypeValue = TestData.Get("mapleTypeValue");
     replacementMap.Add("{oakTypeValue}", oakTypeValue);
     replacementMap.Add("{birchTypeValue}", birchTypeValue);
     replacementMap.Add("{mapleTypeValue}", mapleTypeValue);
     replacementMap.Add("{LocaleLabel}", TestData.Get("LocaleLabel"));
     SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(Path.Combine(dataContainer, AmlSetupFileName), replacementMap));
     SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(Path.Combine(dataContainer, AmlSetupItemInstanceFileName), replacementMap));
 }
Esempio n. 13
0
        protected override void RunSetUpAmls()
        {
            propertiesInExpectedOrder = TestData.Get <Dictionary <string, string> >("PropertiesInExpectedOrder");

            foreach (var property in propertiesInExpectedOrder)
            {
                replacementMap.Add(FormattableString.Invariant($"{{{property.Key}}}"), property.Value);
            }

            replacementMap.Add("{LocaleLabel}", TestData.Get("LocaleLabel"));

            SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(amlSetupPath, replacementMap));
        }
Esempio n. 14
0
        protected override void RunSetUpAmls()
        {
            itemTypeProperties = TestData.Get <Dictionary <string, string> >("ItemTypeProperties");

            foreach (var property in itemTypeProperties)
            {
                replacementMap.Add(FormattableString.Invariant($"{{{property.Key}}}"), property.Value);
            }

            replacementMap.Add("{LocaleLabel}", TestData.Get("LocaleLabel"));

            SystemActor.AttemptsTo(
                Apply.Aml.FromParameterizedFile(Path.Combine(AmlFolderPath, SetupAmlName), replacementMap));
        }
        protected override void RunSetUpAmls()
        {
            woodType        = TestData.Get("WoodType");
            confirmingState = TestData.Get("ConfirmingStateLabel");
            creatingState   = TestData.Get("CreatingState");
            completedState  = TestData.Get("CompletedStateLabel");

            replacementMap.Add("{WoodType}", woodType);
            replacementMap.Add("{today}", DateTime.Today.ToShortInnovatorDateTimeString(Settings.CultureInfo));
            replacementMap.Add("{ConfirmingStateLabel}", confirmingState);
            replacementMap.Add("{CreatingState}", creatingState);
            replacementMap.Add("{CompletedStateLabel}", completedState);

            amlOnlyProperties = TestData.Get <Dictionary <string, string> >("amlOnlyProperties");

            foreach (var property in amlOnlyProperties)
            {
                replacementMap.Add(FormattableString.Invariant($"{{{property.Key}}}"), property.Value);
            }

            SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(AmlPath + AmlSetupName, replacementMap));
            SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(AmlPath + AmlItemTypeInstanceSetupName, replacementMap));
        }
Esempio n. 16
0
 protected override void InitActor()
 {
     Actor = SystemActor.AttemptsTo(Create.Actor(UserType.RegularUser));
 }
Esempio n. 17
0
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(Apply.Aml.FromFile(Path.Combine(dataContainer, "S_1_012_Cleanup.xml")));
 }
Esempio n. 18
0
 public RegisterModel(IOptions <UserSettings> userSettings, SystemActor system)
 {
     _salt = Encoding.UTF8.GetBytes(userSettings.Value.Salt);
     _user = system.User;
 }
Esempio n. 19
0
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(amlCleanupPath, replacementMap));
 }
Esempio n. 20
0
 public LoginModel(IOptions <UserSettings> userSettings, SystemActor system)
 {
     _salt = Encoding.UTF8.GetBytes(userSettings.Value.Salt);
     _user = system?.User ?? throw new ArgumentNullException(nameof(system));
 }
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(Apply.Aml.FromFile(Path.Combine(TestDataFolder, "S_1_008_Cleanup.xml")));
 }
Esempio n. 22
0
 protected override void InitActor()
 {
     Actor = SystemActor.AttemptsTo(Create.Actor(UserType.RegularUser));
     replacementMap.Add("{userAliasId1}", Actor.ActorInfo.AliasId);
 }
Esempio n. 23
0
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(Apply.Aml.FromParameterizedFile(Path.Combine(dataContainer, AmlCleanupFileName), replacementMap));
 }
Esempio n. 24
0
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(Apply.Aml.WithPermissions(Actor.ActorInfo).
                            FromFile(Path.Combine(TestDataFolder, "S_1_005_Cleanup.xml")));
 }
Esempio n. 25
0
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(
         Apply.Aml.FromParameterizedFile(Path.Combine(DataContainer, "S_1_006_Cleanup.xml"), replacementMap));
 }
 protected override void DisposeActor()
 {
     SystemActor.AttemptsTo(Dispose.Actors(Actor, Actor2));
 }
Esempio n. 27
0
 public ConstructionSystem(EntityManager entityManager, IActorRefFactory actorRefFactory) : base(entityManager)
 {
     Actor = actorRefFactory.ActorOf(SystemActor.Props(this), "ConstructionSystem");
 }
Esempio n. 28
0
 protected override void RunTearDownAmls()
 {
     SystemActor.AttemptsTo(Apply.Aml.FromFile(amlCleanupPath));
 }