• KultureGeek
  • Comparateur de prix
       
iPhoneAddict
 iAddictv5Notre Application iPhone/iPad
  • Accueil Apps
  • Actualité Apple
  • Keynote Apple
  • Firmwares & iTunes
  • Contactez-nous
Accueil » Liste des Apps » Apps Mac » developpeurs » Rubicon
3.0.0 macOS €Gratuit Avenga Czechia s.r.o 0 0 Swift parser + mock generator + Xcode extension https://github.com/raptorxcz/Rubicon Rubicon generates spys, stub, mocks and dummies for protocols. Generating methods for parent protocol is not supported. example: input: protocol Car { var...
Rubicon

Rubicon

macOS / developpeurs

Gratuit
Obtenir sur l'App Store

Swift parser + mock generator + Xcode extension
https://github.com/raptorxcz/Rubicon

Rubicon generates spys, stub, mocks and dummies for protocols. Generating methods for parent protocol is not supported.

example:

input:

protocol Car {
var name: String? { get }
var color: Int { get set }

@MainActor
func go()
func load(with stuff: Int, label: String) throws -> Int
func isFull() -> Bool
func download() async throws -> [String]
}

output:

spy:

final class CarSpy: Car {
struct Load {
let stuff: Int
let label: String
}

var name: String?
var color: Int
var loadThrowBlock: () -> Void?
var loadReturn: Int
var isFullReturn: Bool
var downloadThrowBlock: () -> Void?
var downloadReturn: [String]

var goCount = 0
var load = [Load]()
var isFullCount = 0
var downloadCount = 0

init(color: Int, loadReturn: Int, isFullReturn: Bool, downloadReturn: [String]) {
self.color = color
self.loadReturn = loadReturn
self.isFullReturn = isFullReturn
self.downloadReturn = downloadReturn
}

func go() {
goCount += 1
}

func load(with stuff: Int, label: String) throws -> Int {
let item = Load(stuff: stuff, label: label)
load.append(item)
try loadThrowBlock?()
return loadReturn
}

func isFull() -> Bool {
isFullCount += 1
return isFullReturn
}

func download() async throws -> [String] {
downloadCount += 1
try downloadThrowBlock?()
return downloadReturn
}
}

stub:

final class CarStub: Car {
var name: String?
var color: Int
var loadThrowBlock: () -> Void?
var loadReturn: Int
var isFullReturn: Bool
var downloadThrowBlock: () -> Void?
var downloadReturn: [String]

init(color: Int, loadReturn: Int, isFullReturn: Bool, downloadReturn: [String]) {
self.color = color
self.loadReturn = loadReturn
self.isFullReturn = isFullReturn
self.downloadReturn = downloadReturn
}

func go() {
}

func load(with stuff: Int, label: String) throws -> Int {
try loadThrowBlock?()
return loadReturn
}

func isFull() -> Bool {
return isFullReturn
}

func download() async throws -> [String] {
try downloadThrowBlock?()
return downloadReturn
}
}

dummy:

final class CarDummy: Car {
var name: String? {
get {
fatalError()
}
}
var color: Int {
get {
fatalError()
}
set {
fatalError()
}
}

func go() {
fatalError()
}

func load(with stuff: Int, label: String) throws -> Int {
fatalError()
}

func isFull() -> Bool {
fatalError()
}

func download() async throws -> [String] {
fatalError()
}
}

usage in tests:

let carSpy = CarSpy()

...

let a1 = carSpy.goCount == 1
let a2 = carSpy.load.count == 1
let a3 = carSpy.load[0].stuff == 2
let a4 = carSpy.load[0].label == "name"

https://github.com/raptorxcz/Rubicon

Xcode extension

Xcode extension can generate test doubles for all or just selected protocols in the current file. The resulting test double can be written to the source file or pasteboard.

En voir plus...

Quoi de neuf dans la dernière version ?

Migrated to Swift Syntax, which fixed many bungs.

  • Screenshot #1 pour Rubicon
  • Screenshot #2 pour Rubicon
  • Screenshot #3 pour Rubicon

D'autres applications du développeur

Chamberlain - FM&S
Chamberlain - FM&S
/ iPhone

Note

(0 note)

Détails sur l'application

Version
3.0.0
Taille
9.7 Mo
Version minimum de macOS
13.3
Dernière mise à jour
22/09/2023
Publié par
Avenga Czechia s.r.o

Newsletter App Store

Recevez chaque jour les meilleures promos

Actualité Apple

Image Apple TV reçoit des dizaines de nominations pour les Golden Globes et les Critics Choice Awards:
Apple TV reçoit des dizaines de nominations pour les Golden Globes et les Critics Choice Awards:
Image Apple dévoile ses outils pour respecter la loi interdisant les réseaux sociaux aux moins de 16 ans en Australie
Apple dévoile ses outils pour respecter la loi interdisant les réseaux sociaux aux moins de 16 ans en Australie
Image L’iPhone 17 obtient la récompense du meilleur smartphone de l’année par MKBHD
L’iPhone 17 obtient la récompense du meilleur smartphone de l’année par MKBHD
Image Apple et Google s’associent pour faciliter le transfert entre iPhone et Android
Apple et Google s’associent pour faciliter le transfert entre iPhone et Android
Partenaires : Actualité iPhone - Culture Geek
©2009-2025 i2CMedia | A propos |