protected override void OnLeave(TestMethod method)
 {
     if (method == TestMethod.Terminate)
     {
         AstoriaTestProperties.Dispose();
     }
 }
 protected override void OnEnter(TestMethod method)
 {
     if (method == TestMethod.Init)
     {
         AstoriaTestProperties.Init();
     }
 }
        /// <summary>Resolves a property from the command line or LTM-alias.</summary>
        /// <param name="propertyName">Name of property to resolve.</param>
        /// <returns>The property value, null if not defined.</returns>
        public static string ResolveProperty(string propertyName)
        {
            string result;

            if (_overriddenProperties == null || !_overriddenProperties.TryGetValue(propertyName, out result))
            {
                result = AstoriaTestProperties.Properties("CommandLine/" + propertyName);
                if (result == null)
                {
                    result = InitString(propertyName);
                }
            }

            return(result);
        }
        protected override IEnumerable <Workspace> Construct(Type t)
        {
            List <Workspace> constructed = new List <Workspace>();
            Workspace        w;

            w = (Workspace)Activator.CreateInstance(t);
            constructed.Add(w);

            if (AstoriaTestProperties.ResolveProperty("Pipeline-LimitWorkspaces") == null)
            {
                // add a workspace with the custom providers (paging/expand/update)
                if (typeof(EdmWorkspace).IsAssignableFrom(t))
                {
                    if (Versioning.Server.SupportsV2Features)
                    {
                        w = (Workspace)Activator.CreateInstance(t);
                        AddExpandProvider(w);
                        constructed.Add(w);
                    }
                }
                else
                {
                    w = (Workspace)Activator.CreateInstance(t);
                    if (Versioning.Server.SupportsV2Features)
                    {
                        AddUpdateProvider(w);
                        AddPagingProvider(w);
                    }

                    AddExpandProvider(w);
                    constructed.Add(w);
                }

                // set all workspaces so far to have max version
                constructed.ForEach(ws => ws.Settings.MaxProtocolVersion = ODataProtocolVersion.V4);
            }

            return(constructed);
        }
 public static String InitString(String property)
 {
     return(AstoriaTestProperties.Properties("Alias/InitString/" + property));
 }