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")); }
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(); } }
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(); } }
public void GetEvaluationSettings_None() { Assert.Throws <InvalidOperationException>( () => CalculatedFieldProvider.CreateEvaluationSettings(CalculatedFieldSettings.Default)); }