Last active
May 1, 2022 22:42
-
-
Save IvsonEmidio/b8c9765952cc77680e74490cfc3d2876 to your computer and use it in GitHub Desktop.
SOLID - OCP - CORRECT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ICar from "./ICar"; | |
class Diablo implements ICar { | |
readonly brand = "Lamborghini"; | |
readonly color = "black"; | |
public getMarketPrice(): Promise<number> { | |
return new Promise((resolve, reject) => { | |
let result = 200; | |
if (typeof result === "number") { | |
resolve(80); | |
} | |
reject(20); | |
}); | |
} | |
} | |
class Soul implements ICar { | |
readonly brand = "Kia"; | |
readonly color = "Red"; | |
public getMarketPrice(): Promise<number> { | |
return new Promise((resolve, reject) => { | |
let result = 200; | |
if (typeof result === "number") { | |
resolve(350); | |
} | |
reject(20); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment