/// <summary>
        /// Gets The model to use for the specified test configuration.
        /// </summary>
        /// <param name="testConfiguration">The test configuration to use.</param>
        /// <returns>The model to use for the test.</returns>
        protected override IEdmModel GetMetadataProvider(ReaderTestConfiguration testConfiguration)
        {
            IEdmModel model = base.GetMetadataProvider(testConfiguration);

            if (model == null)
            {
                // Try to set the cached model if it is null. If the PayloadEdmModel is null cached model will stay null.
                if (this.cachedModel == null)
                {
                    this.cachedModel = this.PayloadEdmModel;
                }

                if (this.cachedModel != null)
                {
                    if (this.Annotations != null)
                    {
                        this.cachedModel = EdmModelBuilder.BuildAnnotationModel(this.Annotations, this.cachedModel);
                    }
                }

                model = this.cachedModel;
            }

            return(model);
        }
Exemple #2
0
        /// <summary>
        /// Gets The model to use for the specified test configuration.
        /// </summary>
        /// <param name="testConfiguration">The test configuration to use.</param>
        /// <returns>The model to use for the test.</returns>
        protected virtual IEdmModel GetMetadataProvider(ReaderTestConfiguration testConfiguration)
        {
            if (this.cachedModel == null && this.Model != null)
            {
                if (this.Annotations != null)
                {
                    this.cachedModel = EdmModelBuilder.BuildAnnotationModel(this.Annotations, this.Model);
                }
                else
                {
                    this.cachedModel = this.Model;
                }
            }

            return(this.cachedModel);
        }