diff _test/Test/SQL/Schema.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents 6148f89bb7bf
children 4ddb27ff4a0b
line wrap: on
line diff
--- a/_test/Test/SQL/Schema.pm	Tue Apr 10 08:13:22 2012 +0400
+++ b/_test/Test/SQL/Schema.pm	Tue Apr 10 20:08:29 2012 +0400
@@ -74,28 +74,28 @@
 };
 
 test SetPrimaryKey => sub {
-	my ($this) = @_;
-	
-	my $tableUser = $this->schemaDB->GetTable('User');
-	my $tableRole = $this->schemaDB->GetTable('Role');
-	
-	$tableUser->AddConstraint( pk => { columns => ['Id'], name => 'PK' });
-	$tableRole->SetPrimaryKey('Id');
-	
-	$tableUser->primaryKey->HasColumn('Id') or failed "A primary key of 'User' table should contain 'Id' column";
-	$tableRole->primaryKey->HasColumn('Id') or failed "A primary key of 'Role' table should contain 'Id' column";
-	
+    my ($this) = @_;
+    
+    my $tableUser = $this->schemaDB->GetTable('User');
+    my $tableRole = $this->schemaDB->GetTable('Role');
+    
+    $tableUser->AddConstraint( pk => { columns => ['Id'], name => 'PK' });
+    $tableRole->SetPrimaryKey('Id');
+    
+    $tableUser->primaryKey->HasColumn('Id') or failed "A primary key of 'User' table should contain 'Id' column";
+    $tableRole->primaryKey->HasColumn('Id') or failed "A primary key of 'Role' table should contain 'Id' column";
+    
 };
 
 test LinkTables => sub {
-	my ($this) = @_;
-	
-	my $tableUser = $this->schemaDB->GetTable('User');
-	my $tableRole = $this->schemaDB->GetTable('Role');
-	
-	$tableUser->LinkTo($tableRole,'RoleId');
-	
-	$tableUser->GetColumnConstraints('RoleId') == 1 or failed "Wrong constraints count for 'RoleId' column", $tableUser->GetColumnConstraints('RoleId');
+    my ($this) = @_;
+    
+    my $tableUser = $this->schemaDB->GetTable('User');
+    my $tableRole = $this->schemaDB->GetTable('Role');
+    
+    $tableUser->LinkTo($tableRole,'RoleId');
+    
+    $tableUser->GetColumnConstraints('RoleId') == 1 or failed "Wrong constraints count for 'RoleId' column", $tableUser->GetColumnConstraints('RoleId');
 };
 
 test AddConstraint => sub {
@@ -116,44 +116,44 @@
 };
 
 test RemoveConstraint => sub {
-	my ($this) = @_;
-	
-	my $table = $this->schemaDB->GetTable('Role') or failed "Failed to get a table";
-	my $constraint = $table->GetConstraint('Role_ObsoleteId_Uniq');
-	
-	eval {
-		$table->RemoveColumn('ObsoleteId');
-		1;
-	} and failed "Should not remove column with constraint";
-	
-	$table->RemoveColumn('ObsoleteId','force');
+    my ($this) = @_;
+    
+    my $table = $this->schemaDB->GetTable('Role') or failed "Failed to get a table";
+    my $constraint = $table->GetConstraint('Role_ObsoleteId_Uniq');
+    
+    eval {
+        $table->RemoveColumn('ObsoleteId');
+        1;
+    } and failed "Should not remove column with constraint";
+    
+    $table->RemoveColumn('ObsoleteId','force');
     
     failed "A constraint remains alive after column deletion" unless $constraint->isDisposed;
-	
+    
 };
 
 test RemoveTable => sub {
-	my ($this) = @_;
-	
-	my $table = $this->schemaDB->GetTable('Role') or failed "Failed to get a table";
-	
-	$this->schemaDB->RemoveTable('Role');
-	
-	$table->isDisposed or failed "A table remains alive after deletion";
-	
-	my $table2 = $this->schemaDB->GetTable('User');
-	
-	$table2->GetColumnConstraints('RoleId') == 0 or failed "A foreign key keept alive";
+    my ($this) = @_;
+    
+    my $table = $this->schemaDB->GetTable('Role') or failed "Failed to get a table";
+    
+    $this->schemaDB->RemoveTable('Role');
+    
+    $table->isDisposed or failed "A table remains alive after deletion";
+    
+    my $table2 = $this->schemaDB->GetTable('User');
+    
+    $table2->GetColumnConstraints('RoleId') == 0 or failed "A foreign key keept alive";
 };
 
 test Clone => sub {
-	my ($this) = @_;
-	
-	my $clone1 = $this->schemaDB->Clone();
-	
-	$clone1->Dispose();
-	
-	$this->schemaDB->isDisposed and failed "An original schema should not be disposed";
+    my ($this) = @_;
+    
+    my $clone1 = $this->schemaDB->Clone();
+    
+    $clone1->Dispose();
+    
+    $this->schemaDB->isDisposed and failed "An original schema should not be disposed";
 };
 
 test Dispose => sub {