[CM-798] Created IconographyCategory and added unit test to test it
This commit is contained in:
parent
5164b682de
commit
68c8c11038
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// IconographyCategory.swift
|
||||
//
|
||||
// Created by Y Media Labs on 12/09/22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Category for images
|
||||
public struct IconographyCategory: Classification {
|
||||
typealias View = CatalogDisplayView<IconographyView>
|
||||
/// Name of the category
|
||||
public var name: String
|
||||
/// Represents destination of the IconographyCategory
|
||||
public var destination: Destination {
|
||||
CatalogDetailDestination<View>(navigationTitle: "IconCategory", models: models)
|
||||
}
|
||||
var models: [View.Model]
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// CategoriesTest.swift
|
||||
//
|
||||
// Created by Y Media Labs on 12/09/22.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import YCatalogViewer
|
||||
|
||||
final class CategoriesTest: XCTestCase {
|
||||
func testIconographyCategory() {
|
||||
let model = [
|
||||
CatalogDisplayView<IconographyView>.Model(
|
||||
title: "title1",
|
||||
detail: "detail1",
|
||||
displayViewAxis: .horizontal,
|
||||
displayViewModel: UIImage(systemName: "person.fill") ?? UIImage()
|
||||
)
|
||||
]
|
||||
let category = IconographyCategory(name: "Icons", models: model)
|
||||
XCTAssertEqual("IconCategory", category.destination.navigationTitle)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue