Ejemplo n.º 1
0
        public void GetModelID_AndThen_GetModel_ReturnsOriginalModel()
        {
            EdmModel model   = new EdmModel();
            string   modelID = ModelContainer.GetModelID(model);

            Assert.Same(model, ModelContainer.GetModel(modelID));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        private IEdmModel GetModel()
        {
            Contract.Assert(ModelID != null);

            return(ModelContainer.GetModel(ModelID));
        }