@@ -20,7 +20,8 @@ func TestIgniteRocket(t *testing.T) {
2020 rocket := NewRocket ("Saturn-V" , "Nasa" , 5 , 25000 )
2121 rocket .AddFuel (100 )
2222
23- _ = rocket .Ignite ()
23+ //nolint:errcheck
24+ rocket .Ignite ()
2425 got := rocket .Engines .Ignited
2526 want := true
2627
@@ -49,14 +50,16 @@ func TestThrottleUpEnginesNotIgnited(t *testing.T) {
4950 }
5051}
5152
53+ //nolint:errcheck
5254func TestThrottleUp (t * testing.T ) {
5355 rocket := NewRocket ("Saturn-V" , "Nasa" , 5 , 25000 )
5456 rocket .AddFuel (100 )
5557
56- _ = rocket .Ignite ()
58+ rocket .Ignite ()
59+
60+ rocket .ThrottleUp (100 )
61+ rocket .ThrottleUp (100 )
5762
58- _ , _ = rocket .ThrottleUp (100 )
59- _ , _ = rocket .ThrottleUp (100 )
6063 got , _ := rocket .ThrottleUp (100 )
6164 want := 300
6265
@@ -65,13 +68,14 @@ func TestThrottleUp(t *testing.T) {
6568 }
6669}
6770
71+ //nolint:errcheck
6872func TestThrottleUpExceedMaxSpped (t * testing.T ) {
6973 rocket := NewRocket ("Saturn-V" , "Nasa" , 5 , 25000 )
7074 rocket .AddFuel (100 )
7175
72- _ = rocket .Ignite ()
76+ rocket .Ignite ()
7377
74- _ , _ = rocket .ThrottleUp (25000 )
78+ rocket .ThrottleUp (25000 )
7579 _ , err := rocket .ThrottleUp (100 )
7680
7781 if err == nil {
@@ -90,16 +94,17 @@ func TestThrottleDownEnginesNotIgnited(t *testing.T) {
9094 }
9195}
9296
97+ //nolint:errcheck
9398func TestThrottleDown (t * testing.T ) {
9499 rocket := NewRocket ("Saturn-V" , "Nasa" , 5 , 25000 )
95100 rocket .AddFuel (100 )
96101
97- _ = rocket .Ignite ()
102+ rocket .Ignite ()
98103
99- _ , _ = rocket .ThrottleUp (1000 )
100- _ , _ = rocket .ThrottleUp (100 )
101- _ , _ = rocket .ThrottleUp (100 )
102- _ , _ = rocket .ThrottleDown (10 )
104+ rocket .ThrottleUp (1000 )
105+ rocket .ThrottleUp (100 )
106+ rocket .ThrottleUp (100 )
107+ rocket .ThrottleDown (10 )
103108 got , _ := rocket .ThrottleDown (10 )
104109 want := 1180
105110
@@ -108,31 +113,33 @@ func TestThrottleDown(t *testing.T) {
108113 }
109114}
110115
116+ //nolint:errcheck
111117func TestThrottleDownToUnder1000 (t * testing.T ) {
112118 rocket := NewRocket ("Saturn-V" , "Nasa" , 5 , 25000 )
113119 rocket .AddFuel (100 )
114120
115- _ = rocket .Ignite ()
121+ rocket .Ignite ()
116122
117- _ , _ = rocket .ThrottleUp (900 )
123+ rocket .ThrottleUp (900 )
118124 _ , err := rocket .ThrottleDown (10 )
119125
120126 if err == nil {
121127 t .Errorf ("Expected error when attempting to throttle down with resulting speed less than 1000" )
122128 }
123129}
124130
131+ //nolint:errcheck
125132func TestCurrentSpeed (t * testing.T ) {
126133 rocket := NewRocket ("Saturn-V" , "Nasa" , 5 , 25000 )
127134 rocket .AddFuel (100 )
128135
129- _ = rocket .Ignite ()
136+ rocket .Ignite ()
130137
131- _ , _ = rocket .ThrottleUp (1000 )
132- _ , _ = rocket .ThrottleUp (100 )
133- _ , _ = rocket .ThrottleDown (10 )
134- _ , _ = rocket .ThrottleUp (100 )
135- _ , _ = rocket .ThrottleDown (5 )
138+ rocket .ThrottleUp (1000 )
139+ rocket .ThrottleUp (100 )
140+ rocket .ThrottleDown (10 )
141+ rocket .ThrottleUp (100 )
142+ rocket .ThrottleDown (5 )
136143
137144 got := rocket .CurrentSpeed ()
138145 want := 1185
0 commit comments