浏览代码

Completed part 5.0

William Brown 6 年前
父节点
当前提交
816666a604

+ 119
- 117
.idea/workspace.xml 查看文件

@@ -2,8 +2,9 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="c0f7ce67-c21c-4eff-a696-290be3222ea8" name="Default Changelist" comment="">
5
-      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestStudent.java" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestInstructor.java" afterDir="false" />
7 8
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8 9
     </list>
9 10
     <ignored path="$PROJECT_DIR$/target/" />
@@ -24,6 +25,9 @@
24 25
       <FILTER>io.zipcoder.interfaces.*</FILTER>
25 26
     </SUITE>
26 27
   </component>
28
+  <component name="CoverageViewManager">
29
+    <option name="myElementSize" value="176" />
30
+  </component>
27 31
   <component name="FUSProjectUsageTrigger">
28 32
     <session id="-945268981">
29 33
       <usages-collector id="statistics.lifecycle.project">
@@ -34,54 +38,35 @@
34 38
       </usages-collector>
35 39
       <usages-collector id="statistics.file.extensions.open">
36 40
         <counts>
37
-          <entry key="java" value="5" />
41
+          <entry key="java" value="10" />
38 42
           <entry key="project" value="1" />
39 43
         </counts>
40 44
       </usages-collector>
41 45
       <usages-collector id="statistics.file.types.open">
42 46
         <counts>
43 47
           <entry key="Eclipse" value="1" />
44
-          <entry key="JAVA" value="5" />
48
+          <entry key="JAVA" value="10" />
45 49
         </counts>
46 50
       </usages-collector>
47 51
       <usages-collector id="statistics.file.extensions.edit">
48 52
         <counts>
49
-          <entry key="java" value="714" />
53
+          <entry key="java" value="1755" />
50 54
         </counts>
51 55
       </usages-collector>
52 56
       <usages-collector id="statistics.file.types.edit">
53 57
         <counts>
54
-          <entry key="JAVA" value="714" />
58
+          <entry key="JAVA" value="1755" />
55 59
         </counts>
56 60
       </usages-collector>
57 61
     </session>
58 62
   </component>
59 63
   <component name="FileEditorManager">
60 64
     <leaf>
61
-      <file pinned="false" current-in-tab="false">
62
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Person.java">
63
-          <provider selected="true" editor-type-id="text-editor">
64
-            <state relative-caret-position="179">
65
-              <caret line="13" column="21" selection-start-line="13" selection-start-column="21" selection-end-line="13" selection-end-column="21" />
66
-              <folding>
67
-                <element signature="e#231#232#0" expanded="true" />
68
-                <element signature="e#259#260#0" expanded="true" />
69
-                <element signature="e#129#130#0" expanded="true" />
70
-                <element signature="e#156#157#0" expanded="true" />
71
-                <element signature="e#196#197#0" expanded="true" />
72
-                <element signature="e#228#229#0" expanded="true" />
73
-                <element signature="e#439#440#0" expanded="true" />
74
-                <element signature="e#464#465#0" expanded="true" />
75
-              </folding>
76
-            </state>
77
-          </provider>
78
-        </entry>
79
-      </file>
80
-      <file pinned="false" current-in-tab="false">
81
-        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestPerson.java">
65
+      <file pinned="false" current-in-tab="true">
66
+        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestInstructor.java">
82 67
           <provider selected="true" editor-type-id="text-editor">
83
-            <state relative-caret-position="233">
84
-              <caret line="27" column="8" lean-forward="true" selection-start-line="27" selection-start-column="8" selection-end-line="30" selection-end-column="41" />
68
+            <state relative-caret-position="267">
69
+              <caret line="42" column="27" selection-start-line="42" selection-start-column="27" selection-end-line="42" selection-end-column="27" />
85 70
               <folding>
86 71
                 <element signature="imports" expanded="true" />
87 72
               </folding>
@@ -90,42 +75,30 @@
90 75
         </entry>
91 76
       </file>
92 77
       <file pinned="false" current-in-tab="false">
93
-        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java">
78
+        <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java">
94 79
           <provider selected="true" editor-type-id="text-editor">
95
-            <state relative-caret-position="45">
96
-              <caret line="3" column="37" selection-start-line="3" selection-start-column="37" selection-end-line="3" selection-end-column="37" />
97
-            </state>
98
-          </provider>
99
-        </entry>
100
-      </file>
101
-      <file pinned="false" current-in-tab="false">
102
-        <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestStudent.java">
103
-          <provider selected="true" editor-type-id="text-editor">
104
-            <state relative-caret-position="308">
105
-              <caret line="34" column="29" selection-start-line="34" selection-start-column="29" selection-end-line="34" selection-end-column="29" />
80
+            <state relative-caret-position="315">
81
+              <caret line="21" column="1" lean-forward="true" selection-start-line="21" selection-start-column="1" selection-end-line="21" selection-end-column="1" />
106 82
               <folding>
107
-                <element signature="imports" expanded="true" />
83
+                <element signature="e#138#139#0" expanded="true" />
84
+                <element signature="e#169#170#0" expanded="true" />
85
+                <element signature="e#203#204#0" expanded="true" />
86
+                <element signature="e#228#229#0" expanded="true" />
87
+                <element signature="e#292#293#0" expanded="true" />
88
+                <element signature="e#315#316#0" expanded="true" />
108 89
               </folding>
109 90
             </state>
110 91
           </provider>
111 92
         </entry>
112 93
       </file>
113
-      <file pinned="false" current-in-tab="true">
94
+      <file pinned="false" current-in-tab="false">
114 95
         <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java">
115 96
           <provider selected="true" editor-type-id="text-editor">
116
-            <state relative-caret-position="188">
117
-              <caret line="15" column="40" selection-start-line="15" selection-start-column="40" selection-end-line="15" selection-end-column="40" />
97
+            <state relative-caret-position="225">
98
+              <caret line="21" selection-start-line="21" selection-end-line="21" />
118 99
               <folding>
119
-                <element signature="e#185#186#0" expanded="true" />
120
-                <element signature="e#216#217#0" expanded="true" />
121
-                <element signature="e#247#248#0" expanded="true" />
122
-                <element signature="e#272#273#0" expanded="true" />
123 100
                 <element signature="e#293#294#0" expanded="true" />
124
-                <element signature="e#339#340#0" expanded="true" />
125
-                <element signature="e#341#342#0" expanded="true" />
126
-                <element signature="e#378#379#0" expanded="true" />
127
-                <element signature="e#438#439#0" expanded="true" />
128
-                <element signature="e#490#491#0" expanded="true" />
101
+                <element signature="e#340#341#0" expanded="true" />
129 102
               </folding>
130 103
             </state>
131 104
           </provider>
@@ -152,6 +125,9 @@
152 125
         <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java" />
153 126
         <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java" />
154 127
         <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestStudent.java" />
128
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java" />
129
+        <option value="$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java" />
130
+        <option value="$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestInstructor.java" />
155 131
       </list>
156 132
     </option>
157 133
   </component>
@@ -239,7 +215,7 @@
239 215
   <component name="PropertiesComponent">
240 216
     <property name="WebServerToolWindowFactoryState" value="false" />
241 217
     <property name="aspect.path.notification.shown" value="true" />
242
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1541215659696" />
218
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1541218571626" />
243 219
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
244 220
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
245 221
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
@@ -256,8 +232,8 @@
256 232
       </list>
257 233
     </option>
258 234
   </component>
259
-  <component name="RunManager" selected="JUnit.TestStudent">
260
-    <configuration name="TestStudent" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
235
+  <component name="RunManager" selected="JUnit.TestInstructor">
236
+    <configuration name="TestInstructor" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
261 237
       <module name="interfaces-1" />
262 238
       <extension name="coverage">
263 239
         <pattern>
@@ -266,12 +242,12 @@
266 242
         </pattern>
267 243
       </extension>
268 244
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
269
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestStudent" />
245
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestInstructor" />
270 246
       <method v="2">
271 247
         <option name="Make" enabled="true" />
272 248
       </method>
273 249
     </configuration>
274
-    <configuration name="TestStudent.testImplementation" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
250
+    <configuration name="TestInstructor.testImplementation" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
275 251
       <module name="interfaces-1" />
276 252
       <extension name="coverage">
277 253
         <pattern>
@@ -280,14 +256,14 @@
280 256
         </pattern>
281 257
       </extension>
282 258
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
283
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestStudent" />
259
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestInstructor" />
284 260
       <option name="METHOD_NAME" value="testImplementation" />
285 261
       <option name="TEST_OBJECT" value="method" />
286 262
       <method v="2">
287 263
         <option name="Make" enabled="true" />
288 264
       </method>
289 265
     </configuration>
290
-    <configuration name="TestStudent.testInheritance" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
266
+    <configuration name="TestInstructor.testInheritance" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
291 267
       <module name="interfaces-1" />
292 268
       <extension name="coverage">
293 269
         <pattern>
@@ -296,14 +272,14 @@
296 272
         </pattern>
297 273
       </extension>
298 274
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
299
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestStudent" />
275
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestInstructor" />
300 276
       <option name="METHOD_NAME" value="testInheritance" />
301 277
       <option name="TEST_OBJECT" value="method" />
302 278
       <method v="2">
303 279
         <option name="Make" enabled="true" />
304 280
       </method>
305 281
     </configuration>
306
-    <configuration name="TestStudent.testLearn" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
282
+    <configuration name="TestInstructor.testLecture" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
307 283
       <module name="interfaces-1" />
308 284
       <extension name="coverage">
309 285
         <pattern>
@@ -312,14 +288,14 @@
312 288
         </pattern>
313 289
       </extension>
314 290
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
315
-      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestStudent" />
316
-      <option name="METHOD_NAME" value="testLearn" />
291
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestInstructor" />
292
+      <option name="METHOD_NAME" value="testLecture" />
317 293
       <option name="TEST_OBJECT" value="method" />
318 294
       <method v="2">
319 295
         <option name="Make" enabled="true" />
320 296
       </method>
321 297
     </configuration>
322
-    <configuration name="io.zipcoder.interfaces in interfaces-1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
298
+    <configuration name="TestInstructor.testTeach" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
323 299
       <module name="interfaces-1" />
324 300
       <extension name="coverage">
325 301
         <pattern>
@@ -328,25 +304,27 @@
328 304
         </pattern>
329 305
       </extension>
330 306
       <option name="PACKAGE_NAME" value="io.zipcoder.interfaces" />
331
-      <option name="TEST_OBJECT" value="package" />
307
+      <option name="MAIN_CLASS_NAME" value="io.zipcoder.interfaces.TestInstructor" />
308
+      <option name="METHOD_NAME" value="testTeach" />
309
+      <option name="TEST_OBJECT" value="method" />
332 310
       <method v="2">
333 311
         <option name="Make" enabled="true" />
334 312
       </method>
335 313
     </configuration>
336 314
     <list>
337
-      <item itemvalue="JUnit.TestStudent.testImplementation" />
338
-      <item itemvalue="JUnit.TestStudent.testInheritance" />
339
-      <item itemvalue="JUnit.TestStudent.testLearn" />
340
-      <item itemvalue="JUnit.TestStudent" />
341
-      <item itemvalue="JUnit.io.zipcoder.interfaces in interfaces-1" />
315
+      <item itemvalue="JUnit.TestInstructor.testImplementation" />
316
+      <item itemvalue="JUnit.TestInstructor.testTeach" />
317
+      <item itemvalue="JUnit.TestInstructor.testLecture" />
318
+      <item itemvalue="JUnit.TestInstructor.testInheritance" />
319
+      <item itemvalue="JUnit.TestInstructor" />
342 320
     </list>
343 321
     <recent_temporary>
344 322
       <list>
345
-        <item itemvalue="JUnit.TestStudent" />
346
-        <item itemvalue="JUnit.TestStudent.testImplementation" />
347
-        <item itemvalue="JUnit.io.zipcoder.interfaces in interfaces-1" />
348
-        <item itemvalue="JUnit.TestStudent.testLearn" />
349
-        <item itemvalue="JUnit.TestStudent.testInheritance" />
323
+        <item itemvalue="JUnit.TestInstructor" />
324
+        <item itemvalue="JUnit.TestInstructor.testLecture" />
325
+        <item itemvalue="JUnit.TestInstructor.testTeach" />
326
+        <item itemvalue="JUnit.TestInstructor.testInheritance" />
327
+        <item itemvalue="JUnit.TestInstructor.testImplementation" />
350 328
       </list>
351 329
     </recent_temporary>
352 330
   </component>
@@ -360,44 +338,44 @@
360 338
       <option name="number" value="Default" />
361 339
       <option name="presentableId" value="Default" />
362 340
       <updated>1541213342172</updated>
363
-      <workItem from="1541213343574" duration="2003000" />
341
+      <workItem from="1541213343574" duration="4761000" />
364 342
     </task>
365 343
     <servers />
366 344
   </component>
367 345
   <component name="TestHistory">
368
-    <history-entry file="TestPerson_testConstructor - 2018.11.02 at 23h 00m 15s.xml">
369
-      <configuration name="TestPerson.testConstructor" configurationId="JUnit" />
346
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 00m 03s.xml">
347
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
370 348
     </history-entry>
371
-    <history-entry file="TestPerson_testConstructorId - 2018.11.02 at 23h 00m 21s.xml">
372
-      <configuration name="TestPerson.testConstructorId" configurationId="JUnit" />
349
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 00m 34s.xml">
350
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
373 351
     </history-entry>
374
-    <history-entry file="TestPerson_testConstructorId - 2018.11.02 at 23h 00m 24s.xml">
375
-      <configuration name="TestPerson.testConstructorId" configurationId="JUnit" />
352
+    <history-entry file="TestInstructor_testLecture - 2018.11.03 at 00h 03m 04s.xml">
353
+      <configuration name="TestInstructor.testLecture" configurationId="JUnit" />
376 354
     </history-entry>
377
-    <history-entry file="TestPerson - 2018.11.02 at 23h 00m 29s.xml">
378
-      <configuration name="TestPerson" configurationId="JUnit" />
355
+    <history-entry file="TestInstructor_testInheritance - 2018.11.03 at 00h 04m 06s.xml">
356
+      <configuration name="TestInstructor.testInheritance" configurationId="JUnit" />
379 357
     </history-entry>
380
-    <history-entry file="TestPerson_testSetName - 2018.11.02 at 23h 03m 13s.xml">
381
-      <configuration name="TestPerson.testSetName" configurationId="JUnit" />
358
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 08m 02s.xml">
359
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
382 360
     </history-entry>
383
-    <history-entry file="TestPerson - 2018.11.02 at 23h 03m 23s.xml">
384
-      <configuration name="TestPerson" configurationId="JUnit" />
361
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 11m 43s.xml">
362
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
385 363
     </history-entry>
386
-    <history-entry file="TestStudent_testInheritance - 2018.11.02 at 23h 17m 24s.xml">
387
-      <configuration name="TestStudent.testInheritance" configurationId="JUnit" />
364
+    <history-entry file="TestPerson_testConstructorId - 2018.11.03 at 00h 12m 02s.xml">
365
+      <configuration name="TestPerson.testConstructorId" configurationId="JUnit" />
388 366
     </history-entry>
389
-    <history-entry file="TestStudent_testLearn - 2018.11.02 at 23h 21m 58s.xml">
390
-      <configuration name="TestStudent.testLearn" configurationId="JUnit" />
367
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 12m 09s.xml">
368
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
391 369
     </history-entry>
392
-    <history-entry file="TestStudent_testLearn - 2018.11.02 at 23h 22m 11s.xml">
393
-      <configuration name="TestStudent.testLearn" configurationId="JUnit" />
370
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 12m 27s.xml">
371
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
394 372
     </history-entry>
395
-    <history-entry file="TestStudent_testLearn - 2018.11.02 at 23h 22m 55s.xml">
396
-      <configuration name="TestStudent.testLearn" configurationId="JUnit" />
373
+    <history-entry file="TestInstructor_testTeach - 2018.11.03 at 00h 13m 37s.xml">
374
+      <configuration name="TestInstructor.testTeach" configurationId="JUnit" />
397 375
     </history-entry>
398 376
   </component>
399 377
   <component name="TimeTrackingManager">
400
-    <option name="totallyTimeSpent" value="2003000" />
378
+    <option name="totallyTimeSpent" value="4761000" />
401 379
   </component>
402 380
   <component name="ToolWindowManager">
403 381
     <frame x="0" y="0" width="1280" height="800" extended-state="0" />
@@ -413,7 +391,7 @@
413 391
       <window_info anchor="bottom" id="Messages" weight="0.32876712" />
414 392
       <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
415 393
       <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
416
-      <window_info anchor="bottom" id="Terminal" />
394
+      <window_info anchor="bottom" id="Terminal" weight="0.32876712" />
417 395
       <window_info anchor="bottom" id="Event Log" side_tool="true" />
418 396
       <window_info anchor="bottom" id="Message" order="0" />
419 397
       <window_info anchor="bottom" id="Find" order="1" />
@@ -471,6 +449,23 @@
471 449
         </state>
472 450
       </provider>
473 451
     </entry>
452
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestStudent.java">
453
+      <provider selected="true" editor-type-id="text-editor">
454
+        <state relative-caret-position="15">
455
+          <caret line="7" column="4" selection-start-line="7" selection-start-column="4" selection-end-line="38" selection-end-column="5" />
456
+          <folding>
457
+            <element signature="imports" expanded="true" />
458
+          </folding>
459
+        </state>
460
+      </provider>
461
+    </entry>
462
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Teacher.java">
463
+      <provider selected="true" editor-type-id="text-editor">
464
+        <state relative-caret-position="45">
465
+          <caret line="3" column="4" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="4" />
466
+        </state>
467
+      </provider>
468
+    </entry>
474 469
     <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Learner.java">
475 470
       <provider selected="true" editor-type-id="text-editor">
476 471
         <state relative-caret-position="45">
@@ -478,31 +473,38 @@
478 473
         </state>
479 474
       </provider>
480 475
     </entry>
481
-    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestStudent.java">
476
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java">
482 477
       <provider selected="true" editor-type-id="text-editor">
483
-        <state relative-caret-position="308">
484
-          <caret line="34" column="29" selection-start-line="34" selection-start-column="29" selection-end-line="34" selection-end-column="29" />
478
+        <state relative-caret-position="225">
479
+          <caret line="21" selection-start-line="21" selection-end-line="21" />
485 480
           <folding>
486
-            <element signature="imports" expanded="true" />
481
+            <element signature="e#293#294#0" expanded="true" />
482
+            <element signature="e#340#341#0" expanded="true" />
487 483
           </folding>
488 484
         </state>
489 485
       </provider>
490 486
     </entry>
491
-    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Student.java">
487
+    <entry file="file://$PROJECT_DIR$/src/main/java/io/zipcoder/interfaces/Instructor.java">
492 488
       <provider selected="true" editor-type-id="text-editor">
493
-        <state relative-caret-position="188">
494
-          <caret line="15" column="40" selection-start-line="15" selection-start-column="40" selection-end-line="15" selection-end-column="40" />
489
+        <state relative-caret-position="315">
490
+          <caret line="21" column="1" lean-forward="true" selection-start-line="21" selection-start-column="1" selection-end-line="21" selection-end-column="1" />
495 491
           <folding>
496
-            <element signature="e#185#186#0" expanded="true" />
497
-            <element signature="e#216#217#0" expanded="true" />
498
-            <element signature="e#247#248#0" expanded="true" />
499
-            <element signature="e#272#273#0" expanded="true" />
500
-            <element signature="e#293#294#0" expanded="true" />
501
-            <element signature="e#339#340#0" expanded="true" />
502
-            <element signature="e#341#342#0" expanded="true" />
503
-            <element signature="e#378#379#0" expanded="true" />
504
-            <element signature="e#438#439#0" expanded="true" />
505
-            <element signature="e#490#491#0" expanded="true" />
492
+            <element signature="e#138#139#0" expanded="true" />
493
+            <element signature="e#169#170#0" expanded="true" />
494
+            <element signature="e#203#204#0" expanded="true" />
495
+            <element signature="e#228#229#0" expanded="true" />
496
+            <element signature="e#292#293#0" expanded="true" />
497
+            <element signature="e#315#316#0" expanded="true" />
498
+          </folding>
499
+        </state>
500
+      </provider>
501
+    </entry>
502
+    <entry file="file://$PROJECT_DIR$/src/test/java/io/zipcoder/interfaces/TestInstructor.java">
503
+      <provider selected="true" editor-type-id="text-editor">
504
+        <state relative-caret-position="267">
505
+          <caret line="42" column="27" selection-start-line="42" selection-start-column="27" selection-end-line="42" selection-end-column="27" />
506
+          <folding>
507
+            <element signature="imports" expanded="true" />
506 508
           </folding>
507 509
         </state>
508 510
       </provider>

+ 22
- 0
src/main/java/io/zipcoder/interfaces/Instructor.java 查看文件

@@ -0,0 +1,22 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public class Instructor extends Person implements Teacher {
4
+
5
+    public Instructor(long id, String name) {
6
+        super(id, name);
7
+    }
8
+
9
+    public Instructor(long id) {
10
+        super(id);
11
+    }
12
+
13
+    public void teach(Learner learner, double numberOfHours) {
14
+        learner.learn(numberOfHours);
15
+    }
16
+
17
+    public void lecture(Learner[] learners, double numberOfHours) {
18
+        for(int i = 0; i < learners.length; i++) {
19
+            learners[i].learn(numberOfHours / learners.length);
20
+        }
21
+    }
22
+}

+ 7
- 0
src/main/java/io/zipcoder/interfaces/Teacher.java 查看文件

@@ -0,0 +1,7 @@
1
+package io.zipcoder.interfaces;
2
+
3
+public interface Teacher {
4
+    void teach(Learner learner, double numberOfHours);
5
+
6
+    void lecture(Learner[] learners, double numberOfHours);
7
+}

+ 50
- 0
src/test/java/io/zipcoder/interfaces/TestInstructor.java 查看文件

@@ -0,0 +1,50 @@
1
+package io.zipcoder.interfaces;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class TestInstructor {
7
+
8
+    @Test
9
+    public void testImplementation(){
10
+        Instructor instructor = new Instructor(54, "Mr.Bean");
11
+        Assert.assertTrue(instructor instanceof Person);
12
+    }
13
+
14
+    @Test
15
+    public void testInheritance(){
16
+        Instructor instructor = new Instructor(54, "Mr.Bean");
17
+        Assert.assertTrue(instructor instanceof Teacher);
18
+    }
19
+
20
+    @Test
21
+    public void testTeach(){
22
+        Instructor instructor = new Instructor(54, "Mr.Bean");
23
+        Student student = new Student(1, "William");
24
+
25
+        instructor.teach(student, 2);
26
+
27
+        double expected = 2;
28
+        double actual = student.totalStudyTime;
29
+
30
+        Assert.assertEquals(expected, actual, 0);
31
+    }
32
+
33
+    @Test
34
+    public void testLecture(){
35
+        Instructor instructor = new Instructor(54, "Mr.Bean");
36
+        Student William = new Student(1, "William");
37
+        Student James = new Student(3, "James");
38
+
39
+        Learner[] learners = {William, James};
40
+
41
+        instructor.lecture(learners, 2);
42
+
43
+        double expected = 1;
44
+        double actualWilliam = William.totalStudyTime;
45
+        double actualJames = James.totalStudyTime;
46
+
47
+        Assert.assertEquals(expected, actualWilliam, 0);
48
+        Assert.assertEquals(expected, actualJames, 0);
49
+    }
50
+}