Example #1
0
        public void GetEvaluationSettings_FromCalcSettings()
        {
            CalculatedFieldSettings calcSettings = new CalculatedFieldSettings();

            calcSettings.TimeZone = "Japan/Tokyo";

            EvaluationSettings evalSettings = CalculatedFieldProvider.CreateEvaluationSettings(calcSettings);

            Assert.That(evalSettings.TimeZoneName, Is.EqualTo("Japan/Tokyo"));
        }
Example #2
0
        public void GetEvaluationSettings_FromRequestContext()
        {
            try
            {
                RequestContext.SetContext(null, null, null, "Japan/Tokyo");

                EvaluationSettings evalSettings = CalculatedFieldProvider.CreateEvaluationSettings(CalculatedFieldSettings.Default);
                Assert.That(evalSettings.TimeZoneName, Is.EqualTo("Japan/Tokyo"));
            }
            finally
            {
                RequestContext.FreeContext();
            }
        }
Example #3
0
        public void GetEvaluationSettings_Both()
        {
            try
            {
                RequestContext.SetContext(null, null, null, "Japan/Tokyo");

                CalculatedFieldSettings calcSettings = new CalculatedFieldSettings();
                calcSettings.TimeZone = "Australia/Brisbane";

                EvaluationSettings evalSettings = CalculatedFieldProvider.CreateEvaluationSettings(calcSettings);
                Assert.That(evalSettings.TimeZoneName, Is.EqualTo("Australia/Brisbane"));
            }
            finally
            {
                RequestContext.FreeContext();
            }
        }
Example #4
0
 public void GetEvaluationSettings_None()
 {
     Assert.Throws <InvalidOperationException>(
         () => CalculatedFieldProvider.CreateEvaluationSettings(CalculatedFieldSettings.Default));
 }