import flexunit.framework.TestCase;
import mx.events.ValidationResultEvent;
public class CompositeEmailValidatorTest extends TestCase
{
public function CompositeEmailValidatorTest()
{
}
public function testSingleEmail():void
{
var validator:CompositeEmailValidator = new CompositeEmailValidator();
var result:ValidationResultEvent = validator.validate( "wdb@company.com" );
assertEquals( ValidationResultEvent.VALID, result.type );
}
public function testSingleEmailInvalid():void
{
var validator:CompositeEmailValidator = new CompositeEmailValidator();
var result:ValidationResultEvent = validator.validate( "wdbcompany.com" );
assertEquals( ValidationResultEvent.INVALID, result.type );
}
public function testMultipleEmails():void
{
var validator:CompositeEmailValidator = new CompositeEmailValidator();
var result:ValidationResultEvent = validator.validate( "wdb@company.com;tl@company.com" );
assertEquals( ValidationResultEvent.VALID, result.type );
}
public function testMultipleEmailsInvalid():void
{
var validator:CompositeEmailValidator = new CompositeEmailValidator();
var result:ValidationResultEvent = validator.validate( "wdb@company.com;tlcompany.com" );
assertEquals( ValidationResultEvent.INVALID, result.type );
}
}