Created
March 21, 2025 18:44
-
-
Save trikitrok/f6b4aa142a5126a6c10a0e6bb6edceae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export class RSCWorkflow { | |
private static MAX_LENGTH: number = 200; | |
//... more code | |
public validate(packet: Packet): void { | |
if (packet.getOriginator() === "MIA" | |
|| packet.getLength() > RSCWorkflow.MAX_LENGTH | |
|| !packet.hasValidCheckSum()) { | |
throw new InvalidFlowException(); | |
} | |
//... more code that does not use any instance data or methods | |
} | |
//... more code | |
} | |
////////////////////////////////////////////// | |
export class RSCWorkflow { | |
private static MAX_LENGTH: number = 200; | |
//... more code | |
//!! we made it static for testing :( | |
public static validate(packet: Packet): void { | |
if (packet.getOriginator() === "MIA" | |
|| packet.getLength() > RSCWorkflow.MAX_LENGTH | |
|| !packet.hasValidCheckSum()) { | |
throw new InvalidFlowException(); | |
} | |
//... more code that does not use instance data or methods | |
} | |
//... more code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment