[CM-893] Renamed iconography to icon in code and unit test cases

This commit is contained in:
PanchamiShenoy 2022-09-29 10:35:24 +05:30 committed by PanchamiShenoy
parent 852eba4057
commit 5aaea7c536
4 changed files with 19 additions and 19 deletions

View File

@ -1,5 +1,5 @@
//
// IconographyCategory.swift
// IconCategory.swift
//
// Created by Y Media Labs on 12/09/22.
//
@ -7,9 +7,9 @@
import Foundation
/// Category for images
public struct IconographyCategory: Classification {
public struct IconCategory: Classification {
/// The type of View category supports
public typealias View = CatalogDisplayView<IconographyView>
public typealias View = CatalogDisplayView<IconView>
/// Name of the category
public let name: String

View File

@ -1,5 +1,5 @@
//
// IconographyView.swift
// IconView.swift
//
// Created by Y Media Labs on 27/07/22.
//
@ -7,8 +7,8 @@
import UIKit
/// A view to display a given image at a fixed size and ratio
final public class IconographyView: UIImageView {
/// The type of data required to populate the iconography view
final public class IconView: UIImageView {
/// The type of data required to populate the Icon view
public typealias Model = UIImage
private enum Style {
@ -18,13 +18,13 @@ final public class IconographyView: UIImageView {
/// :nodoc:
public override init(frame: CGRect) {
super.init(frame: frame)
setUpIconographyView()
setUpIconView()
}
/// :nodoc:
public required init?(coder: NSCoder) { nil }
private func setUpIconographyView() {
private func setUpIconView() {
contentMode = .scaleAspectFit
NSLayoutConstraint.activate([
self.widthAnchor.constraint(equalToConstant: Style.size.width),
@ -35,7 +35,7 @@ final public class IconographyView: UIImageView {
// MARK: - Populatable
extension IconographyView: Populatable {
extension IconView: Populatable {
/// :nodoc:
public func populate(with model: Model) {
self.image = model
@ -44,7 +44,7 @@ extension IconographyView: Populatable {
// MARK: - Reusable
extension IconographyView: Reusable {
extension IconView: Reusable {
/// :nodoc:
public func prepareForReuse() {
self.image = nil

View File

@ -8,15 +8,15 @@ import XCTest
@testable import YCatalogViewer
final class CategoriesTest: XCTestCase {
func testIconographyCategory() {
func testIconCategory() {
let model = [
CatalogDisplayView<IconographyView>.Model(
CatalogDisplayView<IconView>.Model(
title: "title1",
detail: "detail1",
model: UIImage(systemName: "person.fill") ?? UIImage()
)
]
let category = IconographyCategory(name: "Icons", models: model)
let category = IconCategory(name: "Icons", models: model)
XCTAssertEqual(category.name, category.destination.navigationTitle)
}

View File

@ -1,5 +1,5 @@
//
// IconographyViewTest.swift
// IconViewTest.swift
//
// Created by Y Media Labs on 01/08/22.
//
@ -7,9 +7,9 @@
import XCTest
@testable import YCatalogViewer
final class IconographyViewTest: XCTestCase {
final class IconViewTest: XCTestCase {
func testInitWithCoder() throws {
let sut = IconographyView(coder: try makeCoder(for: makeSUT()))
let sut = IconView(coder: try makeCoder(for: makeSUT()))
XCTAssertNil(sut)
}
@ -31,9 +31,9 @@ final class IconographyViewTest: XCTestCase {
}
}
private extension IconographyViewTest {
func makeSUT(file: StaticString = #filePath, line: UInt = #line) -> IconographyView {
let sut = IconographyView(frame: .zero)
private extension IconViewTest {
func makeSUT(file: StaticString = #filePath, line: UInt = #line) -> IconView {
let sut = IconView(frame: .zero)
trackForMemoryLeak(sut, file: file, line: line)
return sut
}