private void ValidateUpgradingMapping(Domain domain, ModelMapping mapping, bool isAdditionalNode)
 {
     foreach (var schemaNode in mapping.GetAllSchemaNodes())
     {
         Assert.DoesNotThrow(() => { var schema = schemaNode.Schema; });
         Assert.DoesNotThrow(() => { var catalog = schemaNode.Schema.Catalog; });
         Assert.DoesNotThrow(() => { var name = schemaNode.Name; });
         Assert.DoesNotThrow(() => { var dbName = schemaNode.DbName; });
         if (!domain.Configuration.ShareStorageSchemaOverNodes)
         {
             Assert.DoesNotThrow(() => { var schemaName = schemaNode.Schema.Name; });
             Assert.DoesNotThrow(() => { var schemaDbName = schemaNode.Schema.DbName; });
             Assert.DoesNotThrow(() => { var catalogName = schemaNode.Schema.Catalog.Name; });
             Assert.DoesNotThrow(() => { var catalogDbName = schemaNode.Schema.Catalog.DbName; });
         }
         else if (isAdditionalNode)
         {
             Assert.DoesNotThrow(() => { var schemaName = schemaNode.Schema.Name; });
             Assert.DoesNotThrow(() => { var schemaDbName = schemaNode.Schema.DbName; });
             Assert.DoesNotThrow(() => { var catalogName = schemaNode.Schema.Catalog.Name; });
             Assert.DoesNotThrow(() => { var catalogDbName = schemaNode.Schema.Catalog.DbName; });
         }
         else
         {
             Assert.Throws <InvalidOperationException>(() => { var schemaName = schemaNode.Schema.Name; });
             Assert.Throws <InvalidOperationException>(() => { var schemaDbName = schemaNode.Schema.DbName; });
             Assert.Throws <InvalidOperationException>(() => { var catalogName = schemaNode.Schema.Catalog.Name; });
             Assert.Throws <InvalidOperationException>(() => { var catalogDbName = schemaNode.Schema.Catalog.DbName; });
         }
     }
 }
        private void ValidateFinalMappings(Domain domain, ModelMapping mapping)
        {
            var readingNamesDenied = domain.Configuration.ShareStorageSchemaOverNodes;

            foreach (var schemaNode in mapping.GetAllSchemaNodes())
            {
                Assert.DoesNotThrow(() => { var schema = schemaNode.Schema; });
                Assert.DoesNotThrow(() => { var catalog = schemaNode.Schema.Catalog; });
                Assert.DoesNotThrow(() => { var name = schemaNode.Name; });
                Assert.DoesNotThrow(() => { var dbName = schemaNode.DbName; });
                if (readingNamesDenied)
                {
                    Assert.Throws <InvalidOperationException>(() => { var schemaName = schemaNode.Schema.Name; });
                    Assert.Throws <InvalidOperationException>(() => { var schemaDbName = schemaNode.Schema.DbName; });
                    Assert.Throws <InvalidOperationException>(() => { var catalogName = schemaNode.Schema.Catalog.Name; });
                    Assert.Throws <InvalidOperationException>(() => { var catalogDbName = schemaNode.Schema.Catalog.DbName; });
                }
                else
                {
                    Assert.DoesNotThrow(() => { var schemaName = schemaNode.Schema.Name; });
                    Assert.DoesNotThrow(() => { var schemaDbName = schemaNode.Schema.DbName; });
                    Assert.DoesNotThrow(() => { var catalogName = schemaNode.Schema.Catalog.Name; });
                    Assert.DoesNotThrow(() => { var catalogDbName = schemaNode.Schema.Catalog.DbName; });
                }
            }
        }