Refactor SwiftUI extension generation and generation SwiftUI extension for images
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@ -23,7 +23,8 @@ final class ColorExtensionGeneratorTests: XCTestCase {
|
||||
// When
|
||||
let extensionContent = ColorExtensionGenerator.getExtensionContent(colors: colors,
|
||||
staticVar: false,
|
||||
extensionName: "GenColors")
|
||||
extensionName: "GenColors",
|
||||
isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -58,7 +59,8 @@ final class ColorExtensionGeneratorTests: XCTestCase {
|
||||
// When
|
||||
let extensionContent = ColorExtensionGenerator.getExtensionContent(colors: colors,
|
||||
staticVar: true,
|
||||
extensionName: "GenColor")
|
||||
extensionName: "GenColor",
|
||||
isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
|
@ -17,7 +17,7 @@ final class ParsedColorTests: XCTestCase {
|
||||
let color = ParsedColor(name: "red", light: "#FF0000", dark: "#0000FF")
|
||||
|
||||
// When
|
||||
let property = color.getColorProperty()
|
||||
let property = color.getColorProperty(isStatic: false, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -35,7 +35,7 @@ final class ParsedColorTests: XCTestCase {
|
||||
let color = ParsedColor(name: "red", light: "#FF0000", dark: "#0000FF")
|
||||
|
||||
// When
|
||||
let property = color.getColorStaticProperty()
|
||||
let property = color.getColorProperty(isStatic: true, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
|
@ -23,7 +23,8 @@ final class FontExtensionGeneratorTests: XCTestCase {
|
||||
// When
|
||||
let extensionContent = FontExtensionGenerator.getExtensionContent(fontsNames: fontNames,
|
||||
staticVar: false,
|
||||
extensionName: "GenFonts")
|
||||
extensionName: "GenFonts",
|
||||
isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
|
@ -17,7 +17,7 @@ final class FontNameTests: XCTestCase {
|
||||
let fontName: FontName = "CircularStdBold"
|
||||
|
||||
// When
|
||||
let property = fontName.staticProperty
|
||||
let property = fontName.getProperty(isStatic: true, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -34,7 +34,7 @@ final class FontNameTests: XCTestCase {
|
||||
let fontName: FontName = "[Circular_Std+Bold-Underline]"
|
||||
|
||||
// When
|
||||
let property = fontName.staticProperty
|
||||
let property = fontName.getProperty(isStatic: true, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -51,7 +51,7 @@ final class FontNameTests: XCTestCase {
|
||||
let fontName: FontName = "CircularStdBold"
|
||||
|
||||
// When
|
||||
let property = fontName.method
|
||||
let property = fontName.getProperty(isStatic: false, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -68,7 +68,7 @@ final class FontNameTests: XCTestCase {
|
||||
let fontName: FontName = "[Circular_Std+Bold-Underline]"
|
||||
|
||||
// When
|
||||
let property = fontName.method
|
||||
let property = fontName.getProperty(isStatic: false, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
|
@ -24,7 +24,8 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
let extensionContent = ImageExtensionGenerator.getExtensionContent(images: images,
|
||||
staticVar: false,
|
||||
extensionName: "GenImages",
|
||||
inputFilename: "myInputFilename")
|
||||
inputFilename: "myInputFilename",
|
||||
isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -59,7 +60,8 @@ final class ImageExtensionGeneratorTests: XCTestCase {
|
||||
let extensionContent = ImageExtensionGenerator.getExtensionContent(images: images,
|
||||
staticVar: true,
|
||||
extensionName: "GenImages",
|
||||
inputFilename: "myInputFilename")
|
||||
inputFilename: "myInputFilename",
|
||||
isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
|
@ -43,7 +43,7 @@ final class ParsedImageTests: XCTestCase {
|
||||
height: 10)
|
||||
|
||||
// When
|
||||
let property = parsedImage.getImageProperty()
|
||||
let property = parsedImage.getImageProperty(isStatic: false, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
@ -64,7 +64,7 @@ final class ParsedImageTests: XCTestCase {
|
||||
height: 10)
|
||||
|
||||
// When
|
||||
let property = parsedImage.getStaticImageProperty()
|
||||
let property = parsedImage.getImageProperty(isStatic: true, isSwiftUI: false)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
|
Reference in New Issue
Block a user