コード例 #1
0
        private void OKExecute(object obj)
        {
            bool allMappingsValid = true;

            bool isValid;
            var  mappings = GetMappings(out isValid);

            allMappingsValid &= isValid;

            if (mappings != null)
            {
                foreach (var m in mappings)
                {
                    var mappingsValid = m.PhaidraAttribute.ValidateMappings(m);
                    if (!mappingsValid)
                    {
                        Logger.LogW($"Mappings of Attribute {m.PhaidraAttribute.Name} invalid");
                    }
                    allMappingsValid &= mappingsValid;
                }
            }
            if (allMappingsValid)
            {
                DialogResult = true;
                CloseAction?.Invoke();
            }
            else
            {
                DebugCommand.Execute(null);
            }
        }
コード例 #2
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            await DebugCommand.Execute(Target, PlayerId, CommandString, Param1, Param2, Param3, Param4, _logger);

            return(RedirectToPage("./Cheat", new { id = member_no }));
        }
コード例 #3
0
    public async Task ShouldReturnSuccessfulResult()
    {
        var command = new DebugCommand(ApplicationContext);
        var text    = command.Aliases[0];
        var message = GenerateMessage(DefaultUser.Id, DefaultUser.Id, text);

        var result = await command.Execute(message, DefaultUser);

        result.Should().BeOfType <SuccessfulResult>();
        result.Message.Should().NotBeNullOrEmpty();
    }