forked from appsquickly/XcodeEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXcodeFileReferenceTypeTests.m
More file actions
41 lines (33 loc) · 1.43 KB
/
XcodeFileReferenceTypeTests.m
File metadata and controls
41 lines (33 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
////////////////////////////////////////////////////////////////////////////////
//
// JASPER BLUES
// Copyright 2012 Jasper Blues
// All Rights Reserved.
//
// NOTICE: Jasper Blues permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
#import "XcodeSourceFileType.h"
#import <XCTest/XCTest.h>
@interface XcodeFileReferenceTypeTests : XCTestCase
@end
@implementation XcodeFileReferenceTypeTests
- (void)test_return_a_file_reference_type_from_a_string
{
XCTAssertTrue(XCSourceFileTypeFromStringRepresentation(@"sourcecode.c.h") == SourceCodeHeader);
XCTAssertTrue(XCSourceFileTypeFromStringRepresentation(@"sourcecode.c.objc") == SourceCodeObjC);
}
- (void)test_creates_a_string_from_a_file_reference_type
{
XCTAssertEqualObjects(NSStringFromXCSourceFileType(SourceCodeHeader), @"sourcecode.c.h");
XCTAssertEqualObjects(NSStringFromXCSourceFileType(SourceCodeObjC), @"sourcecode.c.objc");
}
- (void)test_returns_file_type_from_file_name
{
XCTAssertEqual(XCSourceFileTypeFromFileName(@"foobar.c"), SourceCodeObjC);
XCTAssertEqual(XCSourceFileTypeFromFileName(@"foobar.m"), SourceCodeObjC);
XCTAssertEqual(XCSourceFileTypeFromFileName(@"foobar.mm"), SourceCodeObjCPlusPlus);
XCTAssertEqual(XCSourceFileTypeFromFileName(@"foobar.cpp"), SourceCodeCPlusPlus);
}
@end