public void CreateStorageMappingItemCollection_returns_errors_for_invalid_ssdl() { var v3 = new Version(3, 0, 0, 0); var edmItemCollection = EdmExtension.CreateAndValidateEdmItemCollection(Csdl, v3); var storeItemCollection = EdmExtension.CreateAndValidateStoreItemCollection( Ssdl, v3, resolver, false); var invalidMsl = XDocument.Parse(Msl); invalidMsl .Descendants("{http://schemas.microsoft.com/ado/2009/11/mapping/cs}ScalarProperty") .First() .SetAttributeValue("Name", "Non-existing-property"); IList <EdmSchemaError> edmErrors; var storageMappingItemCollection = EdmExtension.CreateStorageMappingItemCollection( edmItemCollection, storeItemCollection, invalidMsl.ToString(), out edmErrors); Assert.Null(storageMappingItemCollection); Assert.Equal(1, edmErrors.Count); Assert.Contains("'Non-existing-property'", edmErrors[0].Message); }
public void CreateStorageMappingItemCollection_creates_storage_mapping_item_collection_for_valid_artifacts() { var v3 = new Version(3, 0, 0, 0); var edmItemCollection = EdmExtension.CreateAndValidateEdmItemCollection(Csdl, v3); var storeItemCollection = EdmExtension.CreateAndValidateStoreItemCollection( Ssdl, v3, resolver, false); IList <EdmSchemaError> edmErrors; var storageMappingItemCollection = EdmExtension.CreateStorageMappingItemCollection( edmItemCollection, storeItemCollection, Msl, out edmErrors); Assert.NotNull(storageMappingItemCollection); Assert.Equal(0, edmErrors.Count); Assert.NotNull(storageMappingItemCollection.GetItem <GlobalItem>("AdventureWorksEntities3")); }