mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Tests: Unit tests for CPURLRequest
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
@import <OJUnit/OJTestCase.j>
|
||||
|
||||
|
||||
var exampleURL = "http://www.cappuccino-project.org";
|
||||
|
||||
@implementation CPURLRequestTest : OJTestCase
|
||||
{
|
||||
}
|
||||
|
||||
- (void)testClassMethods
|
||||
{
|
||||
var url = [CPURL URLWithString:exampleURL],
|
||||
req = [CPURLRequest requestWithURL:url];
|
||||
|
||||
[self assert:[req HTTPMethod] equals:@"GET"];
|
||||
[self assert:[req URL] equals:url];
|
||||
}
|
||||
|
||||
- (void)testWithCredentials
|
||||
{
|
||||
var url = [CPURL URLWithString:exampleURL],
|
||||
req = [CPURLRequest requestWithURL:url];
|
||||
|
||||
[self assertFalse:[req withCredentials]];
|
||||
|
||||
[req setWithCredentials:YES];
|
||||
[self assertTrue:[req withCredentials]];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user