Unit Test in BOO.
"""
Author: Jonathan Mark,
Program: Boo Language Test File
Date: 2006
Description: This file contains classes for testing
features of the Boo language
"""
namespace BooDatabase
import NUnit.Framework from "nunit.framework"
import System
import System.Collections
import System.Data.OracleClient
[TestFixture]
class testDatabase:
[Test]
def helloWorld():
connectionString = "Data Source=XE;User ID=system;Password=acpg;"
dbcon = OracleConnection(connectionString)
dbcon.Open()
dbcmd = dbcon.CreateCommand()
sql = "SELECT user, 'hello' as myhello from dual"
dbcmd.CommandText = sql
reader = dbcmd.ExecuteReader()
while reader.Read():
nombre = reader["user"]
descripcion = reader["myhello"]
print "Tabla: ${nombre} Descripción: ${descripcion}"
Assert.AreEqual(descripcion,"hello")
x = 1
while x = 1:
x = 1
Author: Jonathan Mark
Program: Boo Language Test File
Date: 2006
Description: This file contains classes for testing
features of the Boo language
"""
namespace BooDatabase
import NUnit.Framework from "nunit.framework"
import System
import System.Collections
import System.Data.OracleClient
[TestFixture]
class testDatabase:
[Test]
def helloWorld():
connectionString = "Data Source=XE;User ID=system;Password=acpg;"
dbcon = OracleConnection(connectionString)
dbcon.Open()
dbcmd = dbcon.CreateCommand()
sql = "SELECT user, 'hello' as myhello from dual"
dbcmd.CommandText = sql
reader = dbcmd.ExecuteReader()
while reader.Read():
nombre = reader["user"]
descripcion = reader["myhello"]
print "Tabla: ${nombre} Descripción: ${descripcion}"
Assert.AreEqual(descripcion,"hello")
x = 1
while x = 1:
x = 1

0 Comments:
Post a Comment
<< Home