[CM-798] Created IconographyCategory and added unit test to test it

This commit is contained in:
PanchamiShenoy 2022-09-12 12:39:43 +05:30 committed by PanchamiShenoy
parent 5164b682de
commit 68c8c11038
2 changed files with 42 additions and 0 deletions

View File

@ -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]
}

View File

@ -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)
}
}