mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-21 08:24:40 +00:00
- README.md is added
- Change the name to factory is done - Local variable type inference is used
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.iluwatar.factory;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void shouldExecuteWithoutExceptions() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.iluwatar.factory;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class CarsFactoryTest {
|
||||
|
||||
@Test
|
||||
void shouldReturnFerrariInstance() {
|
||||
final var ferrari = CarsFactory.getCar(CarsFactory.CarType.FERRARI);
|
||||
assertTrue(ferrari instanceof Ferrari);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user