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
func TestMitraGetByPhoneNumber(t *testing.T) { | |
var mitraFieldNames = []string{"id", "phone", "email", "password"} | |
rows := sqlmock.NewRows(mitraFieldNames) | |
rows.AddRow("1", "0812345678", "abdul@gmail.com", "abcdefghi") | |
db, mock, _ := sqlmock.New() | |
gormDb, _ := gorm.Open("postgres", db) | |
gormDb.LogMode(true) | |
} |
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
// Class ORM | |
type Mitra struct { | |
gorm.Model | |
Phone string `gorm:"type:varchar(50);not null;unique default:null"` | |
Email string `gorm:"type:varchar(50);not null;unique"` | |
Password string | |
} | |
type MitraRepository struct { | |
} |
NewerOlder