//
//  XTUrlStringlValueTransformerTests.m
//  TadsTerp
//
//  Created by Rune Berg on 18/10/14.
//  Copyright (c) 2014 Rune Berg. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <XCTest/XCTest.h>
#import "XTFileUrlStringValueTransformer.h"

//TODo ren ...FileUrl

@interface XTUrlStringlValueTransformerTests : XCTestCase

@property XTFileUrlStringValueTransformer *transformer;

@end


@implementation XTUrlStringlValueTransformerTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
	self.transformer = [XTFileUrlStringValueTransformer new];
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

//TODO write more test cases

- (void)testTransform {

	NSURL *url = [NSURL URLWithString:@"file:///dir1/dir2"];
	NSString *string = [self.transformer transformedValue:url];

	XCTAssertEqualObjects(@"/dir1/dir2", string);
}

- (void)testReverseTransform {
	
	NSString *string = @"/dir1/dir2";
	NSURL *url = [self.transformer reverseTransformedValue:string];

	XCTAssertEqualObjects(@"file:///dir1/dir2", url.absoluteString);
}

@end
