Skip to content

Commit

Permalink
Added AFImageResponseSerializerTests class.
Browse files Browse the repository at this point in the history
  • Loading branch information
quellish committed Mar 14, 2016
1 parent 32cf30a commit 77f6fe1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AFNetworking.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
1BF9F9601C87832B00F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; };
1FE783011C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */; };
1FE783021C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */; };
1FE783031C5857A200A73B7C /* httpbinorg_01192017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */; };
Expand Down Expand Up @@ -221,6 +222,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageResponseSerializerTests.m; sourceTree = "<group>"; };
1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_01192017.cer; sourceTree = "<group>"; };
2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIButtonTests.m; sourceTree = "<group>"; };
297824A01BC2D69A0041C395 /* adn_0.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_0.cer; path = ADNNetServerTrustChain/adn_0.cer; sourceTree = "<group>"; };
Expand Down Expand Up @@ -433,6 +435,7 @@
298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */,
298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */,
29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */,
1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */,
298D7C871BC2C88F00FD3B3E /* AFNetworkReachabilityManagerTests.m */,
298D7C891BC2C88F00FD3B3E /* AFSecurityPolicyTests.m */,
298D7C8F1BC2C88F00FD3B3E /* AFURLSessionManagerTests.m */,
Expand Down Expand Up @@ -975,6 +978,7 @@
298D7CB11BC2CA6E00FD3B3E /* AFHTTPRequestSerializationTests.m in Sources */,
297824AE1BC2DBD80041C395 /* AFUIActivityIndicatorViewTests.m in Sources */,
297824AD1BC2DBA40041C395 /* AFNetworkActivityManagerTests.m in Sources */,
1BF9F9601C87832B00F1F35A /* AFImageResponseSerializerTests.m in Sources */,
298D7CDD1BC2CAF700FD3B3E /* AFSecurityPolicyTests.m in Sources */,
298D7CD31BC2CAE800FD3B3E /* AFHTTPResponseSerializationTests.m in Sources */,
297824B01BC2DC2D0041C395 /* AFUIImageViewTests.m in Sources */,
Expand Down
45 changes: 45 additions & 0 deletions Tests/Tests/AFImageResponseSerializerTests.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// AFImageResponseSerializerTests.m
// Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <XCTest/XCTest.h>
#import "AFTestCase.h"
#import "AFURLResponseSerialization.h"

@interface AFImageResponseSerializerTests : AFTestCase

@end

@implementation AFImageResponseSerializerTests

- (void)testCanBeCopied {
AFImageResponseSerializer *responseSerializer = [AFImageResponseSerializer serializer];
AFImageResponseSerializer *copiedSerializer = [responseSerializer copy];
XCTAssertNotNil(copiedSerializer);
XCTAssertNotEqual(copiedSerializer, responseSerializer);
XCTAssertTrue(copiedSerializer.acceptableContentTypes.count == responseSerializer.acceptableContentTypes.count);
XCTAssertTrue(copiedSerializer.acceptableStatusCodes.count == responseSerializer.acceptableStatusCodes.count);
}

- (void)testSupportsSecureCoding {
XCTAssertTrue([AFImageResponseSerializer supportsSecureCoding]);
}

@end

0 comments on commit 77f6fe1

Please sign in to comment.