public void ReverseReturnsDeleteForeignKeyExpressionAfterApplyingConventions()
 {
     var expression = new DeleteForeignKeyExpression
     {
         ForeignKey = new ForeignKeyDefinition
         {
             ForeignColumns = new Collection<string> { "User_id" },
             ForeignTable = "UserRoles",
             PrimaryColumns = new Collection<string> { "Id" },
             PrimaryTable = "User",
         }
     };
     expression.ApplyConventions(new MigrationConventions());
     var reverse = expression.Reverse();
     reverse.ShouldBeOfType<CreateForeignKeyExpression>();
 }
 public void ReverseSetsForeignTableAndForeignColumnsAndPrimaryTableAndPrimaryColumnsAOnGeneratedExpression()
 {
     var expression = new DeleteForeignKeyExpression
     {
         ForeignKey = new ForeignKeyDefinition
         {
             ForeignColumns = new Collection<string> { "ForeignId" },
             ForeignTable = "UserRoles",
             PrimaryColumns = new Collection<string> { "PrimaryId" },
             PrimaryTable = "User",
         }
     };
     var reverse = expression.Reverse() as CreateForeignKeyExpression;
     reverse.ForeignKey.ForeignTable.ShouldBe("User");
     reverse.ForeignKey.PrimaryTable.ShouldBe("UserRoles");
     reverse.ForeignKey.ForeignColumns.First().ShouldBe("PrimaryId");
     reverse.ForeignKey.PrimaryColumns.First().ShouldBe("ForeignId");
 }
 public void ReverseReturnsDeleteForeignKeyExpression()
 {
     var expression = new DeleteForeignKeyExpression
     {
         ForeignKey = new ForeignKeyDefinition
         {
             ForeignColumns = new Collection<string> { "User_id" },
             ForeignTable = "UserRoles",
             PrimaryColumns = new Collection<string> { "Id" },
             PrimaryTable = "User",
             Name = "FK"
         }
     };
     var reverse = expression.Reverse();
     reverse.ShouldBeOfType<CreateForeignKeyExpression>();
 }