public void Test_Invalidate_WhenDataChanged()
        {
            EntityType type = null;

            try
            {
                var scenario = CreateScenario("core:stringField", "'TestA '+Name");
                var field    = scenario.Item1;
                var inst     = scenario.Item2;
                type = scenario.Item3;

                // Get provider
                ICalculatedFieldProvider provider = Factory.CalculatedFieldProvider;

                // Run test
                object result = provider.GetCalculatedFieldValue(field.Id, inst.Id, CalculatedFieldSettings.Default);
                CheckResult(result, "TestA Name1");

                // Change data
                inst.Name = "Name9";
                inst.Save();

                result = provider.GetCalculatedFieldValue(field.Id, inst.Id, CalculatedFieldSettings.Default);
                CheckResult(result, "TestA Name9");
            }
            finally
            {
                if (type != null)
                {
                    type.Delete();
                }
            }
        }
        public void Test_FieldTypes(string fieldTypeAlias, string calc, string exected, Type expectedType)
        {
            var scenario = CreateScenario(fieldTypeAlias, calc);
            var field    = scenario.Item1;
            var inst     = scenario.Item2;

            // Get provider
            ICalculatedFieldProvider provider = Factory.CalculatedFieldProvider;

            // Run test
            object result = provider.GetCalculatedFieldValue(field.Id, inst.Id, CalculatedFieldSettings.Default);

            // Check results
            CheckResult(result, exected);
        }