Skip to content

Instantly share code, notes, and snippets.

View brettfazio's full-sized avatar
🐢
<- Turtle

Brett Fazio brettfazio

🐢
<- Turtle
View GitHub Profile
module basicParallel;
integer a, b, c;
initial
fork
$display("Hello!");
a = 5;
b = 4;
c = a + b;
module basicSequential;
integer a, b, c;
initial
begin
$display("Hello!");
a = 5;
b = 4;
c = a + b;
name = 'Brett'
blog_title = 'Medium'
# Hi, my name is Brett and I am writing on my Medium blog.
a = "Hi, my name is {} and I am writing on my {} blog.".format(name, blog_title)
name = 'Brett'
blog_title = 'Medium'
# Hi, my name is Brett and I am writing on my Medium blog.
a = f"Hi, my name is {name} and I am writing on my {blog_title} blog."
from dataclasses import dataclass
# Define dataclass
@dataclass
class Vector3D:
x: int
y: int
z: int
# Create a vector
# In order formatting
# Hi, my name is Brett and I am writing on my Medium blog.
a = "Hi, my name is {} and I am writing on my {} blog.".format('Brett', 'Medium')
# Index formatting
# I'm going to a birthday party because it is Paul's birthday.
a = "I'm going to a {0} party because it is {1}'s {0}".format('birthday', 'Paul')
from enum import Enum
class State(Enum):
AIR = 0
LAND = 1
SEA = 2
myState = State.AIR
# Prints 0
@Test
fun logInFailure_test() {
val email = "cool@cool.com"
val password = "123_456"
Mockito.`when`(mAuth!!.signInWithEmailAndPassword(email, password))
.thenReturn(failureTask)
accountModel!!.logIn(email, password)
assert(logInResult == FAILURE)
}
class LogInModelTest : LogInListener {
private lateinit var successTask: Task<AuthResult>
private lateinit var failureTask: Task<AuthResult>
@Mock
private lateinit val mAuth: FirebaseAuth
private lateinit var logInModel: LogInModel
private var logInResult = UNDEF
override fun logInSuccess(email: String, password: String) {
logInResult = SUCCESS
}
override fun logInFailure(exception: Exception, email: String, password: String) {
logInResult = FAILURE
}
}