Skip to content

Commit

Permalink
[Icons] Add tests for remaining icons. (#8499)
Browse files Browse the repository at this point in the history
Some icon images were not being tested. Adds those missing tests.

Found while working on #8498
  • Loading branch information
Robert Moore committed Sep 25, 2019
1 parent 1ce82c6 commit 2f4b35e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
1 change: 1 addition & 0 deletions components/private/Icons/BUILD
Expand Up @@ -41,6 +41,7 @@ mdc_unit_test_objc_library(
"//components/private/Icons/icons/ic_more_horiz",
"//components/private/Icons/icons/ic_radio_button_unchecked",
"//components/private/Icons/icons/ic_reorder",
"//components/private/Icons/icons/ic_settings",
],
)

Expand Down
50 changes: 36 additions & 14 deletions components/private/Icons/tests/unit/MDCIconsTests.m
Expand Up @@ -13,31 +13,24 @@
// limitations under the License.

#import <XCTest/XCTest.h>

#import "MaterialIcons+ic_arrow_back.h"
#import "MaterialIcons+ic_check.h"
#import "MaterialIcons+ic_check_circle.h"
#import "MaterialIcons+ic_chevron_right.h"
#import "MaterialIcons+ic_color_lens.h"
#import "MaterialIcons+ic_help_outline.h"
#import "MaterialIcons+ic_info.h"
#import "MaterialIcons+ic_more_horiz.h"
#import "MaterialIcons+ic_radio_button_unchecked.h"
#import "MaterialIcons+ic_reorder.h"
#import "MaterialIcons+ic_settings.h"

@interface MDCIconsTests : XCTestCase
@end

@implementation MDCIconsTests

- (void)testImageForInfo {
XCTAssertNotNil([MDCIcons imageFor_ic_info], @"No image was returned for ic_info");
}

- (void)testImageForCheck {
XCTAssertNotNil([MDCIcons imageFor_ic_check], @"No image was returned for ic_check");
}

- (void)testImageForReorder {
XCTAssertNotNil([MDCIcons imageFor_ic_reorder], @"No image was returned for ic_reorder");
}

- (void)testBundleNamed {
// Given
NSString *badBundleName = @"someNameThatDoesNotExist";
Expand All @@ -55,7 +48,7 @@ - (void)testImageForArrowBackOldStyle {

// Then
XCTAssertNotNil([MDCIcons imageFor_ic_arrow_back],
@"No image was returned for ic_arrow_back (old style");
@"No image was returned for ic_arrow_back (old style)");
}

- (void)testImageForArrowBackNewStyle {
Expand All @@ -64,22 +57,51 @@ - (void)testImageForArrowBackNewStyle {

// Then
XCTAssertNotNil([MDCIcons imageFor_ic_arrow_back],
@"No image was returned for ic_arrow_back (new style");
@"No image was returned for ic_arrow_back (new style)");
}

- (void)testImageForCheck {
XCTAssertNotNil([MDCIcons imageFor_ic_check], @"No image was returned for ic_check");
}

- (void)testImageForCheckCircle {
XCTAssertNotNil([MDCIcons imageFor_ic_check_circle],
@"No image was returned for ic_check_circle");
}

- (void)testImageForColorLens {
XCTAssertNotNil([MDCIcons imageFor_ic_color_lens], @"No image was returned for ic_color_lens");
}

- (void)testImageForChevronRight {
XCTAssertNotNil([MDCIcons imageFor_ic_chevron_right],
@"No image was returned for ic_chevron_right");
}

- (void)testImageForHelpOutline {
XCTAssertNotNil([MDCIcons imageFor_ic_help_outline],
@"No image was returned for ic_help_outline");
}

- (void)testImageForInfo {
XCTAssertNotNil([MDCIcons imageFor_ic_info], @"No image was returned for ic_info");
}

- (void)testImageForMoreHoriz {
XCTAssertNotNil([MDCIcons imageFor_ic_more_horiz], @"No image was returned for ic_more_horiz");
}

- (void)testImageForRadioButtonUnchecked {
XCTAssertNotNil([MDCIcons imageFor_ic_radio_button_unchecked],
@"No image was returned for ic_radio_button_unchecked");
}

- (void)testImageForReorder {
XCTAssertNotNil([MDCIcons imageFor_ic_reorder], @"No image was returned for ic_reorder");
}

- (void)testImageForSettings {
XCTAssertNotNil([MDCIcons imageFor_ic_settings], @"No image was returned for ic_settings");
}

@end

0 comments on commit 2f4b35e

Please sign in to comment.