Prev | Current Page 339 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


public var error(default, null) : String;
Another test has been addressed.
The process of creating tests and implementing code is then repeated many times until all the
functionalities desired have been implemented. The result of all those iterations is the completion of the
class ERegValidator ; a new class EmailValidator has also been introduced with its complementary
test case class TestEmailValidator .
176
Part I: The Core Language
class TestEmailValidator extends haxe.unit.TestCase
{
public function testConventional()
{
var v = new EmailValidator(???john@example.com???);
assertTrue(v.validate());
}
public function testDirty()
{
var v = new EmailValidator(???john @example.com???); // spaces are not allowed
assertFalse(v.validate());
}
public function testIncomplete()
{
var v = new EmailValidator(???john???);
assertFalse(v.validate());
}
public function testDoubleDotted()
{
var v = new EmailValidator(???john@example..com???);
assertFalse(v.validate());
}
}
class TestERegValidator extends haxe.


Pages:
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351