Skip to content

Commit

Permalink
wip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
veverkap authored Feb 16, 2022
1 parent e3ff873 commit 133be27
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions internal/codespaces/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"reflect"
"strconv"
"testing"
)
Expand Down Expand Up @@ -265,3 +266,48 @@ func TestRetries(t *testing.T) {
t.Fatalf("expected codespace name to be %q but got %q", csName, cs.Name)
}
}

func TestCodespace_ExportData(t *testing.T) {
type fields struct {
Name string
CreatedAt string
DisplayName string
LastUsedAt string
Owner User
Repository Repository
State string
GitStatus CodespaceGitStatus
Connection CodespaceConnection
Machine CodespaceMachine
}
type args struct {
fields []string
}
tests := []struct {
name string
fields fields
args args
want map[string]interface{}
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &Codespace{
Name: tt.fields.Name,
CreatedAt: tt.fields.CreatedAt,
DisplayName: tt.fields.DisplayName,
LastUsedAt: tt.fields.LastUsedAt,
Owner: tt.fields.Owner,
Repository: tt.fields.Repository,
State: tt.fields.State,
GitStatus: tt.fields.GitStatus,
Connection: tt.fields.Connection,
Machine: tt.fields.Machine,
}
if got := c.ExportData(tt.args.fields); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Codespace.ExportData() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit 133be27

Please sign in to comment.