-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28a61c4
commit 3b0d198
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestConnect(t *testing.T) { | ||
// Create a new instance of FireDB. | ||
db := FireDB{} | ||
|
||
// Call the Connect function. | ||
err := db.Connect() | ||
|
||
// Check if there was an error during connection. | ||
if err != nil { | ||
t.Errorf("Failed to connect to Firebase: %v", err) | ||
} | ||
|
||
// Check if the Firebase Realtime Database client is initialized. | ||
if db.Client == nil { | ||
t.Error("Firebase Realtime Database client is not initialized") | ||
} | ||
} |