private void CompareDomains(Xtensive.Sql.Model.Domain d1, Xtensive.Sql.Model.Domain d2) { Assert.IsNotNull(d1.Name); Assert.IsNotNull(d2.Name); Assert.AreEqual(d1.Name, d2.Name); CompareSqlValueTypes(d1.DataType, d2.DataType); Assert.AreEqual(d1.Schema.Name, d2.Schema.Name); foreach (DomainConstraint dc1 in d1.DomainConstraints) { DomainConstraint dc2 = d2.DomainConstraints[dc1.Name]; Assert.IsNotNull(dc2); CompareDomainConstraints(dc1, dc2); } }
private void CompareSchemas(Schema s1, Schema s2) { Assert.IsNotNull(s1); Assert.IsNotNull(s2); Assert.IsNotNull(s1.Name); Assert.IsNotNull(s2.Name); Assert.AreEqual(s1.Name, s2.Name); //The created model does not assign Owner, it is assigned by PgSql implicitly //Assert.IsNotNull(s1.Owner); Assert.IsNotNull(s2.Owner); Assert.AreEqual(s1.Domains.Count, s2.Domains.Count); Assert.AreEqual(s1.Sequences.Count, s2.Sequences.Count); Assert.AreEqual(s1.Tables.Count, s2.Tables.Count); Assert.AreEqual(s1.Views.Count, s2.Views.Count); foreach (Xtensive.Sql.Model.Domain d1 in s1.Domains) { Xtensive.Sql.Model.Domain d2 = s2.Domains[d1.Name]; Assert.IsNotNull(d2); CompareDomains(d1, d2); } foreach (Sequence sq1 in s1.Sequences) { Sequence sq2 = s2.Sequences[sq1.Name]; Assert.IsNotNull(sq2); CompareSequences(sq1, sq2); } foreach (Table t1 in s1.Tables) { Table t2 = s2.Tables[t1.Name]; Assert.IsNotNull(t2); CompareTables(t1, t2); } foreach (View v1 in s1.Views) { View v2 = s2.Views[v1.Name]; Assert.IsNotNull(v2); CompareViews(v1, v2); } }
/// <inheritdoc/> /// <exception cref="NotSupportedException">Method is not supported.</exception> protected override IPathNode VisitDomain(Xtensive.Sql.Model.Domain domain) { throw new NotSupportedException(); }
/// <summary> /// Visits a domain. /// </summary> /// <param name="domain">The domain.</param> /// <returns>Visit result.</returns> protected abstract TResult VisitDomain(Domain domain);