diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlCheckConstraint.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlCheckConstraint.cs index c5a6935..b17d8ad 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlCheckConstraint.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlCheckConstraint.cs @@ -27,5 +27,11 @@ internal SqlCheckConstraint() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlColumn.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlColumn.cs index cbcad55..71c0c22 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlColumn.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlColumn.cs @@ -77,5 +77,11 @@ internal SqlColumn() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKey.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKey.cs index 255ac5a..9949078 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKey.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKey.cs @@ -45,5 +45,11 @@ internal SqlForeignKey(IList columns) /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKeyColumn.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKeyColumn.cs index 7268aec..3ff61ac 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKeyColumn.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlForeignKeyColumn.cs @@ -32,5 +32,11 @@ internal SqlForeignKeyColumn() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return $"{this.Name} => {this.Referenced}"; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndex.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndex.cs index 32e0525..bb69b09 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndex.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndex.cs @@ -51,5 +51,11 @@ internal SqlIndex(IList columns, IList includedC /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndexColumn.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndexColumn.cs index b7558d9..b9ac16f 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndexColumn.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlIndexColumn.cs @@ -27,5 +27,11 @@ internal SqlIndexColumn() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKey.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKey.cs index eb02ee5..f49ab25 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKey.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKey.cs @@ -35,5 +35,11 @@ internal SqlPrimaryKey(IList columns) /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKeyColumn.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKeyColumn.cs index b87341a..e1b98cb 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKeyColumn.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlPrimaryKeyColumn.cs @@ -27,5 +27,11 @@ internal SqlPrimaryKeyColumn() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlStoredProcedure.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlStoredProcedure.cs index 711e63b..80be7e8 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlStoredProcedure.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlStoredProcedure.cs @@ -32,5 +32,11 @@ internal SqlStoredProcedure() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return $"{this.Schema}.{this.Name}"; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTable.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTable.cs index 1aee53b..10665cc 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTable.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTable.cs @@ -70,5 +70,11 @@ internal SqlTable(IList columns, IList triggers, IList public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return $"{this.Schema}.{this.Name}"; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTrigger.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTrigger.cs index 32eb0ea..11a441f 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTrigger.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlTrigger.cs @@ -32,5 +32,11 @@ internal SqlTrigger() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUniqueConstraint.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUniqueConstraint.cs index 197a803..3f7f7e8 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUniqueConstraint.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUniqueConstraint.cs @@ -35,5 +35,11 @@ internal SqlUniqueConstraint(IList columns) /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUserType.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUserType.cs index 4da915d..886cb87 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUserType.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlUserType.cs @@ -42,5 +42,11 @@ internal SqlUserType() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return this.Name; + } } } diff --git a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlView.cs b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlView.cs index a5d6107..8e26d7c 100644 --- a/src/UnitTests.Databases.SqlServer/ObjectModel/SqlView.cs +++ b/src/UnitTests.Databases.SqlServer/ObjectModel/SqlView.cs @@ -32,5 +32,11 @@ internal SqlView() /// public override TResult Accept(ISqlObjectVisitor visitor) => visitor.Visit(this); + + /// + public override string ToString() + { + return $"{this.Schema}.{this.Name}"; + } } } diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlCheckConstraintTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlCheckConstraintTest.cs new file mode 100644 index 0000000..010d230 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlCheckConstraintTest.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlCheckConstraintTest + { + [Fact] + public void ToStringTest() + { + var checkConstraint = new SqlCheckConstraint() + { + Name = "The name", + Code = default, + }; + + checkConstraint.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlColumnTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlColumnTest.cs new file mode 100644 index 0000000..225bd03 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlColumnTest.cs @@ -0,0 +1,33 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlColumnTest + { + [Fact] + public void ToStringTest() + { + var column = new SqlColumn() + { + Name = "The name", + CollationName = default, + ComputedExpression = default, + IsComputed = default, + IsIdentity = default, + IsNullable = default, + MaxLength = default, + Position = default, + Precision = default, + Scale = default, + SystemTypeId = default, + TypeName = default, + }; + + column.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlForeignKeyColumnTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlForeignKeyColumnTest.cs new file mode 100644 index 0000000..92b1d89 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlForeignKeyColumnTest.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlForeignKeyColumnTest + { + [Fact] + public void ToStringTest() + { + var column = new SqlForeignKeyColumn() + { + Name = "The name", + Referenced = "The referenced", + Position = default, + }; + + column.ToString().Should().Be("The name => The referenced"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlForeignKeyTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlForeignKeyTest.cs new file mode 100644 index 0000000..c43b0b4 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlForeignKeyTest.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlForeignKeyTest + { + [Fact] + public void ToStringTest() + { + var foreignKey = new SqlForeignKey([]) + { + DeleteAction = default, + ReferencedTable = default, + UpdateAction = default, + Name = "The name", + }; + + foreignKey.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlIndexColumnTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlIndexColumnTest.cs new file mode 100644 index 0000000..99b89cb --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlIndexColumnTest.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlIndexColumnTest + { + [Fact] + public void ToStringTest() + { + var column = new SqlIndexColumn() + { + Name = "The name", + Position = default, + }; + + column.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlIndexTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlIndexTest.cs new file mode 100644 index 0000000..2fac41e --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlIndexTest.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlIndexTest + { + [Fact] + public void ToStringTest() + { + var index = new SqlIndex(Array.Empty(), Array.Empty()) + { + Filter = null, + IsUnique = default, + Name = "The name", + Type = default, + }; + + index.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlPrimaryKeyColumnTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlPrimaryKeyColumnTest.cs new file mode 100644 index 0000000..b3e8fe1 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlPrimaryKeyColumnTest.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlPrimaryKeyColumnTest + { + [Fact] + public void ToStringTest() + { + var column = new SqlPrimaryKeyColumn() + { + Name = "The name", + Position = default, + }; + + column.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlPrimaryKeyTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlPrimaryKeyTest.cs new file mode 100644 index 0000000..feabe8a --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlPrimaryKeyTest.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlPrimaryKeyTest + { + [Fact] + public void ToStringTest() + { + var primaryKey = new SqlPrimaryKey([]) + { + Name = "The name", + Type = default, + }; + + primaryKey.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlStoredProcedureTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlStoredProcedureTest.cs new file mode 100644 index 0000000..a2dc6e1 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlStoredProcedureTest.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlStoredProcedureTest + { + [Fact] + public void ToStringTest() + { + var storedProcedure = new SqlStoredProcedure() + { + Name = "The name", + Code = default, + Schema = "The schema", + }; + + storedProcedure.ToString().Should().Be("The schema.The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlTableTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlTableTest.cs new file mode 100644 index 0000000..47d6238 --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlTableTest.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlTableTest + { + [Fact] + public void ToStringTest() + { + var table = new SqlTable([], [], [], [], [], []) + { + Name = "The name", + PrimaryKey = default, + Schema = "The schema", + }; + + table.ToString().Should().Be("The schema.The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlTriggerTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlTriggerTest.cs new file mode 100644 index 0000000..642599b --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlTriggerTest.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlTriggerTest + { + [Fact] + public void ToStringTest() + { + var trigger = new SqlTrigger() + { + Name = "The name", + Code = default, + }; + + trigger.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlUniqueConstraintTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlUniqueConstraintTest.cs new file mode 100644 index 0000000..cdb9e0a --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlUniqueConstraintTest.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlUniqueConstraintTest + { + [Fact] + public void ToStringTest() + { + var uniqueConstraint = new SqlUniqueConstraint([]) + { + Name = "The name", + Type = default, + }; + + uniqueConstraint.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlUserTypeTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlUserTypeTest.cs new file mode 100644 index 0000000..bee742b --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlUserTypeTest.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlUserTypeTest + { + [Fact] + public void ToStringTest() + { + var userType = new SqlUserType() + { + Name = "The name", + IsNullable = default, + IsTableType = default, + MaxLength = default, + SystemTypeId = default + }; + + userType.ToString().Should().Be("The name"); + } + } +} \ No newline at end of file diff --git a/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlViewTest.cs b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlViewTest.cs new file mode 100644 index 0000000..ae0ec5e --- /dev/null +++ b/tests/UnitTests.Databases.SqlServer.Tests/ObjectModel/SqlViewTest.cs @@ -0,0 +1,24 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) P.O.S Informatique. All rights reserved. +// +//----------------------------------------------------------------------- + +namespace PosInformatique.UnitTests.Databases.Tests +{ + public class SqlViewTest + { + [Fact] + public void ToStringTest() + { + var view = new SqlView() + { + Name = "The name", + Code = default, + Schema = "The schema", + }; + + view.ToString().Should().Be("The schema.The name"); + } + } +} \ No newline at end of file