about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-08-18 21:13:59 +0200
committerEmile <hanemile@protonmail.com>2019-08-18 21:13:59 +0200
commit459a5903dc539b12663b1799e37ed7fc98b43604 (patch)
treefbe8b46d45eb0af1588d71ae6b9b388742691fd9
parent2a61f54b7cdb3cf03ec42ec9296bfb83321acb41 (diff)
simple test
-rw-r--r--convert_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/convert_test.go b/convert_test.go
index 690f903..f827319 100644
--- a/convert_test.go
+++ b/convert_test.go
@@ -1 +1,40 @@
 package TLE
+
+import (
+	"reflect"
+	"testing"
+)
+
+func TestStringToTLE(t *testing.T) {
+	type args struct {
+		inputTLE string
+	}
+	tests := []struct {
+		name  string
+		args  args
+		want  TLE
+		want1 error
+	}{
+		{
+			name:  "Simple ISS test",
+			args:  args{
+				inputTLE: `ISS (ZARYA)             
+1 25544U 98067A   19229.39083552  .00000228  00000-0  11917-4 0  9993
+2 25544  51.6447  57.6210 0007373 294.0868 138.8050 15.50381554184754`,
+			},
+			want:  TLE{},
+			want1: nil,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			got, got1 := StringToTLE(tt.args.inputTLE)
+			if !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("StringToTLE() got = %v, want %v", got, tt.want)
+			}
+			if !reflect.DeepEqual(got1, tt.want1) {
+				t.Errorf("StringToTLE() got1 = %v, want %v", got1, tt.want1)
+			}
+		})
+	}
+}
\ No newline at end of file