Exemple #1
0
        public void GetModelID_AndThen_GetModel_ReturnsOriginalModel()
        {
            EdmModel model   = new EdmModel();
            string   modelID = ModelContainer.GetModelID(model);

            Assert.Same(model, ModelContainer.GetModel(modelID));
        }
        public void ProjectAsWrapper_Element_ProjectedValueContainsModelID()
        {
            // Arrange
            Customer           customer     = new Customer();
            SelectExpandClause selectExpand = new SelectExpandClause(new SelectItem[0], allSelected: true);
            Expression         source       = Expression.Constant(customer);

            // Act
            Expression projection = _binder.ProjectAsWrapper(source, selectExpand, _model.Customer);

            // Assert
            SelectExpandWrapper <Customer> customerWrapper = Expression.Lambda(projection).Compile().DynamicInvoke() as SelectExpandWrapper <Customer>;

            Assert.NotNull(customerWrapper.ModelID);
            Assert.Same(_model.Model, ModelContainer.GetModel(customerWrapper.ModelID));
        }
Exemple #3
0
        private IEdmModel GetModel()
        {
            Contract.Assert(ModelID != null);

            return(ModelContainer.GetModel(ModelID));
        }