func test_scale_aspect_fill()

in CyborgTests/AspectRatioTests.swift [61:96]


    func test_scale_aspect_fill() {
        func assertTransformed(from: CGSize,
                               in container: CGSize,
                               to result: CGSize,
                               file: StaticString = #file,
                               line: UInt = #line) {
            XCTAssertEqual(from.scaleAspectFill(in: container),
                           result,
                           file: file,
                           line: line)
        }
        assertTransformed(from: .init(width: 1,
                                      height: 5),
                          in: .init(width: 100,
                                    height: 200),
                          to: .init(width: 100,
                                    height: 500))
        assertTransformed(from: .init(width: 10,
                                      height: 10),
                          in: .init(width: 100,
                                    height: 200),
                          to: .init(width: 200,
                                    height: 200))
        assertTransformed(from: .init(width: 1000,
                                      height: 1000),
                          in: .init(width: 100,
                                    height: 200),
                          to: .init(width: 200,
                                    height: 200))
        assertTransformed(from: .init(width: 1000,
                                      height: 10),
                          in: .init(width: 100,
                                    height: 200),
                          to: .init(width: 20000,
                                    height: 200))
    }