private InputSummary GetFilledRandomInputSummary(string OmitPropName)
        {
            InputSummary inputSummary = new InputSummary();

            if (OmitPropName != "Summary")
            {
                inputSummary.Summary = GetRandomString("", 20);
            }

            return(inputSummary);
        }
Пример #2
0
            public void AddInput(ControllerInputId button, float value)
            {
                InputSummary inputSummary;

                if (!_stats.TryGetValue(button, out inputSummary))
                {
                    inputSummary = new InputSummary();
                    _stats.Add(button, inputSummary);
                }

                inputSummary.AddInput(value);
            }
Пример #3
0
        /// <summary>
        /// Validate function for all InputSummaryService commands
        /// </summary>
        /// <param name="validationContext">System.ComponentModel.DataAnnotations.ValidationContext (Describes the context in which a validation check is performed.)</param>
        /// <param name="actionDBType">[ActionDBTypeEnum] (CSSPEnums.ActionDBTypeEnum.html) action type to validate</param>
        /// <returns>IEnumerable of ValidationResult (Where ValidationResult is a container for the results of a validation request.)</returns>
        private IEnumerable <ValidationResult> Validate(ValidationContext validationContext, ActionDBTypeEnum actionDBType)
        {
            string       retStr       = "";
            Enums        enums        = new Enums(LanguageRequest);
            InputSummary inputSummary = validationContext.ObjectInstance as InputSummary;

            inputSummary.HasErrors = false;

            if (string.IsNullOrWhiteSpace(inputSummary.Summary))
            {
                inputSummary.HasErrors = true;
                yield return(new ValidationResult(string.Format(CSSPServicesRes._IsRequired, "Summary"), new[] { "Summary" }));
            }

            //Summary has no StringLength Attribute

            retStr = "";      // added to stop compiling CSSPError
            if (retStr != "") // will never be true
            {
                inputSummary.HasErrors = true;
                yield return(new ValidationResult("AAA", new[] { "AAA" }));
            }
        }
Пример #4
0
 private bool checkButtonPressed(InputSummary sequence)
 {
     float distance = Math.Abs(sequence.Min - sequence.Avg) + Math.Abs(sequence.Max - sequence.Avg);
     return distance > 1.5; // distance range [0, 2]
 }
Пример #5
0
 public InputSummaryTest()
 {
     inputSummary = new InputSummary();
 }