сделал тест для ReadString
This commit is contained in:
parent
e794c29eff
commit
73d284a458
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Wed May 21 15:59:44 MSK 2025
|
#Wed May 21 15:59:44 MSK 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
23
src/test/java/CLIInputReaderTest.java
Normal file
23
src/test/java/CLIInputReaderTest.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.mockito.Mockito;
|
||||||
|
import ru.dima.weather.cli.CLIInputReader;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
|
public class CLIInputReaderTest {
|
||||||
|
@Test
|
||||||
|
void testReadString() {
|
||||||
|
String simulatedInput = "а";
|
||||||
|
InputStream inputStream = new ByteArrayInputStream(simulatedInput.getBytes());
|
||||||
|
CLIInputReader inputReader = new CLIInputReader(inputStream);
|
||||||
|
|
||||||
|
String result = inputReader.readString();
|
||||||
|
assertEquals("а", result, ":(");
|
||||||
|
}
|
||||||
|
void
|
||||||
|
|
||||||
|
}
|
@ -20,5 +20,7 @@ class CityByIpResolverTest {
|
|||||||
|
|
||||||
var currentCity = cityByIpResolver.getCurrentCityViaIP();
|
var currentCity = cityByIpResolver.getCurrentCityViaIP();
|
||||||
assertEquals(randomCityName, currentCity);
|
assertEquals(randomCityName, currentCity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user