Skip to content

Commit

Permalink
Add Regions table from Northwind to Oracle db, so Oracle tests in Dat…
Browse files Browse the repository at this point in the history
…a solution pass.

#5
  • Loading branch information
tsahi committed Feb 1, 2020
1 parent 0c03de6 commit 6c2a90d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BVT/Data.BVT/Data.BVT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,14 @@
<ItemGroup>
<None Include="Readme.md" />
<Content Include="DatabaseSetupScripts\1.DataAccessQuickStarts.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\1.Table\Region.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\alldata.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\Country.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\Customers.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\Debits.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\Employees.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\Products.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\Region.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\4.Data\truncate.sql" />
<Content Include="DatabaseSetupScripts\OracleDBScripts\3.SP\1.cursor.sql" />
<None Include="DatabaseSetupScripts\OracleDBScripts\3.SP\sp_GUIDTEST.prc" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

CREATE TABLE REGION
(
REGIONID INTEGER NOT NULL,
REGIONDESCRIPTION VARCHAR2 (50 BYTE) NOT NULL
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
);


CREATE UNIQUE INDEX REGION_PK ON REGION
(REGIONID)
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
);


ALTER TABLE REGION ADD (
CONSTRAINT REGION_PK
PRIMARY KEY
(REGIONID)
USING INDEX
TABLESPACE USERS
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Insert Into Region Values (1,'Eastern');
Insert Into Region Values (2,'Western');
Insert Into Region Values (3,'Northern');
Insert Into Region Values (4,'Southern');
6 changes: 6 additions & 0 deletions source/Tests/Oracle.Tests.VSTS/OracleDatabaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public void CanConnectToOracleAndExecuteAReader()
connection.Open();
DbCommand cmd = oracleDatabase.GetSqlStringCommand("Select * from Region");
cmd.CommandTimeout = 0;
cmd.Connection = connection;
using (cmd.ExecuteReader()) { };
connection.Close();
}

[TestMethod]
Expand All @@ -63,6 +66,9 @@ public void CanExecuteCommandWithEmptyPackages()
connection.Open();
DbCommand cmd = oracleDatabase.GetSqlStringCommand("Select * from Region");
cmd.CommandTimeout = 0;
cmd.Connection = connection;
using (cmd.ExecuteReader()) { };
connection.Close();
}

[TestMethod]
Expand Down

0 comments on commit 6c2a90d

Please sign in to comment.