jpsp91 6 lat temu
rodzic
commit
8068271919
3 zmienionych plików z 0 dodań i 157 usunięć
  1. BIN
      ConversionToolTest.class
  2. 0
    43
      ConversionToolTest.ctxt
  3. 0
    114
      ConversionToolTest.java

BIN
ConversionToolTest.class Wyświetl plik


+ 0
- 43
ConversionToolTest.ctxt Wyświetl plik

1
-#BlueJ class context
2
-comment0.target=ConversionToolTest
3
-comment1.params=
4
-comment1.target=void\ shouldConvertCentimetersToInches()
5
-comment10.params=
6
-comment10.target=void\ shouldConvertMetersToFeet()
7
-comment11.params=
8
-comment11.target=void\ shouldConvertZeroMetersToZeroFeet()
9
-comment12.params=
10
-comment12.target=void\ shouldConvertNegativeMetersToZeroFeet()
11
-comment13.params=
12
-comment13.target=void\ shouldConvertFahrenheitToCelsius()
13
-comment14.params=
14
-comment14.target=void\ shouldConvertCelsiusToFahrenheit()
15
-comment15.params=
16
-comment15.target=void\ shouldConvertMphToKph()
17
-comment16.params=
18
-comment16.target=void\ shouldConvertZeroMphToZeroKph()
19
-comment17.params=
20
-comment17.target=void\ shouldConvertNegativeMphToZeroKph()
21
-comment18.params=
22
-comment18.target=void\ shouldConvertKphToMph()
23
-comment19.params=
24
-comment19.target=void\ shouldConvertZeroKphToZeroMph()
25
-comment2.params=
26
-comment2.target=void\ shouldConvertZeroCentimetersToZeroInches()
27
-comment20.params=
28
-comment20.target=void\ shouldConvertNegativeKphToZeroMph()
29
-comment3.params=
30
-comment3.target=void\ shouldConvertNegativeCentimetersToZeroInches()
31
-comment4.params=
32
-comment4.target=void\ shouldConvertInchesToCentimeters()
33
-comment5.params=
34
-comment5.target=void\ shouldConvertZeroInchesToZeroCentimeters()
35
-comment6.params=
36
-comment6.target=void\ shouldConvertNegativeInchesToZeroCentimeters()
37
-comment7.params=
38
-comment7.target=void\ shouldConvertFeetToMeters()
39
-comment8.params=
40
-comment8.target=void\ shouldConvertZeroFeetToZeroMeters()
41
-comment9.params=
42
-comment9.target=void\ shouldConvertNegativeFeetToZeroMeters()
43
-numComments=21

+ 0
- 114
ConversionToolTest.java Wyświetl plik

1
-import static org.junit.Assert.*;
2
-import org.junit.After;
3
-import org.junit.Before;
4
-import org.junit.Test;
5
-
6
-public class ConversionToolTest
7
-{
8
-    @Test
9
-    public void shouldConvertCentimetersToInches() {
10
-        float inches = ConversionTool.CentimetersToInches(2f);
11
-        assertEquals(0.7874f, inches, 0.001);
12
-    }
13
-    @Test
14
-    public void shouldConvertZeroCentimetersToZeroInches() {
15
-        float inches = ConversionTool.CentimetersToInches(0);
16
-        assertEquals(0, inches, 0.0);
17
-    }
18
-    @Test
19
-    public void shouldConvertNegativeCentimetersToZeroInches() {
20
-        float inches = ConversionTool.CentimetersToInches(-5);
21
-        assertEquals(0, inches, 0.0);
22
-    }
23
-
24
-    @Test
25
-    public void shouldConvertInchesToCentimeters() {
26
-        float centimeters = ConversionTool.InchesToCentimeters(4f);
27
-        assertEquals(10.16f, centimeters, 0.001);
28
-    }
29
-    @Test
30
-    public void shouldConvertZeroInchesToZeroCentimeters() {
31
-        float centimeters = ConversionTool.InchesToCentimeters(0);
32
-        assertEquals(0, centimeters, 0.0);
33
-    }
34
-    @Test
35
-    public void shouldConvertNegativeInchesToZeroCentimeters() {
36
-        float centimeters = ConversionTool.InchesToCentimeters(-5);
37
-        assertEquals(0, centimeters, 0.0);
38
-    }
39
-
40
-    @Test
41
-    public void shouldConvertFeetToMeters() {
42
-        float meters = ConversionTool.FeetToMeters(5f);
43
-        assertEquals(1.524f, meters, 0.001);
44
-    }
45
-    @Test
46
-    public void shouldConvertZeroFeetToZeroMeters() {
47
-        float meters = ConversionTool.FeetToMeters(0);
48
-        assertEquals(0, meters, 0.0);
49
-    }
50
-    @Test
51
-    public void shouldConvertNegativeFeetToZeroMeters() {
52
-        float meters = ConversionTool.FeetToMeters(-10);
53
-        assertEquals(0, meters, 0.0);
54
-    }
55
-
56
-    @Test
57
-    public void shouldConvertMetersToFeet() {
58
-        float feet = ConversionTool.MetersToFeet(9f);
59
-        assertEquals(29.5276f, feet, 0.001);
60
-    }
61
-    @Test
62
-    public void shouldConvertZeroMetersToZeroFeet() {
63
-        float feet = ConversionTool.MetersToFeet(0);
64
-        assertEquals(0, feet, 0.0);
65
-    }
66
-    @Test
67
-    public void shouldConvertNegativeMetersToZeroFeet() {
68
-        float feet = ConversionTool.MetersToFeet(-10);
69
-        assertEquals(0, feet, 0.0);
70
-    }
71
-
72
-    @Test
73
-    public void shouldConvertFahrenheitToCelsius() {
74
-        float celsius = ConversionTool.FahrenheitToCelsius(80);
75
-        assertEquals(26.67, celsius, 0.01);
76
-    }
77
-    @Test
78
-    public void shouldConvertCelsiusToFahrenheit() {
79
-        float fahrenheit = ConversionTool.CelsiusToFahrenheit(26.67f);
80
-        assertEquals(80, fahrenheit, 0.01);
81
-    }
82
-
83
-    @Test
84
-    public void shouldConvertMphToKph(){
85
-        float kph = ConversionTool.MphToKph(24f);
86
-        assertEquals(38.62, kph, 0.01);
87
-    }
88
-    @Test
89
-    public void shouldConvertZeroMphToZeroKph(){
90
-        float kph = ConversionTool.MphToKph(0f);
91
-        assertEquals(0, kph, 0.0);
92
-    }
93
-    @Test
94
-    public void shouldConvertNegativeMphToZeroKph(){
95
-        float kph = ConversionTool.MphToKph(-50f);
96
-        assertEquals(0, kph, 0.0);
97
-    }
98
-
99
-    @Test
100
-    public void shouldConvertKphToMph(){
101
-        float mph = ConversionTool.KphToMph(6.44f);
102
-        assertEquals(4, mph, 0.01);
103
-    }
104
-    @Test
105
-    public void shouldConvertZeroKphToZeroMph(){
106
-        float mph = ConversionTool.KphToMph(0f);
107
-        assertEquals(0, mph, 0.0);
108
-    }
109
-    @Test
110
-    public void shouldConvertNegativeKphToZeroMph(){
111
-        float mph = ConversionTool.KphToMph(-50f);
112
-        assertEquals(0, mph, 0.0);
113
-    }
114
-}