Пример #1
0
        private static void PerformTests(ResourceId resourceId, OtherOperations op, string targetField, string fieldValuePairs)
        {
            targetField = GetTargetField(resourceId, FieldsCreator, targetField);
            var request = GenerateComputeFieldValueRequest(resourceId, targetField,
                                                           new Dictionary <string, object>
            {
                [$"{resourceId.ToString()}.{fieldValuePairs}"] = FieldValuePair
            });
            var expression            = GenerateExpressionOtherMath(resourceId, op, fieldValuePairs);
            var effectedTerminalField = ReadField(resourceId, targetField);

            UpdateExpressionField(resourceId, effectedTerminalField.ToString(), expression);
            SendRequestAndVerifyData(request, op);
        }
Пример #2
0
        private static void SendRequestAndVerifyData(Dictionary <string, object> request, OtherOperations op)
        {
            var handler     = new DefaultManager();
            var response    = SendRequestComputeFieldValue(request);
            var targetValue = ComputeOtherMath[op](FieldValuePair);

            PrAssert.That(Math.Round(double.Parse(response.Result.Value), 0), PrIs.EqualTo(Math.Round(targetValue, 0)), "Compute field value is incorrectly.");
        }
Пример #3
0
 public void TestValidComputeFieldValueCustomFieldOtherMath(ResourceId resourceId, OtherOperations op, string fieldValuePair, string targetField)
 {
     PerformTests(resourceId, op, targetField, fieldValuePair);
 }
        private static void SendRequestAndVerifyData(Dictionary <string, object> request, OtherOperations op, string targetField, double targetAffectedValue)
        {
            var handler     = new DefaultManager();
            var response    = SendRequestComputeAffectedField(request);
            var targetValue = ComputeOtherMath[op](targetAffectedValue);

            PrAssert.That(response.Result.AffectedFields.Where(x => x.Field.Contains(targetField)).Select(i => Convert.ToInt32(float.Parse(i.Value))), PrIs.All.EqualTo(Convert.ToInt32(targetValue)), "Compute affected field value is incorrectly.");
        }
 public void TestValidComputationAffectedCustomFieldOtherMath(ResourceId resourceId, OtherOperations op, string targetAffectedField, string targetField)
 {
     PerformTests(resourceId, op, targetField, targetAffectedField);
 }
Пример #6
0
 public static string GenerateExpressionOtherMath(ResourceId resourceId, OtherOperations op, string fieldName)
 {
     return($"{op.GetEnumStringValue()}({resourceId.ToString()}.{fieldName})");
 }