Skip to content

Commit

Permalink
✅Updating tests for main.
Browse files Browse the repository at this point in the history
  • Loading branch information
yansheng836 committed Oct 13, 2019
1 parent 9129359 commit d62fa11
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/test/java/xyz/yansheng/main/AppTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package xyz.yansheng.main;

import java.io.ByteArrayInputStream;

import org.junit.Test;

/**
Expand All @@ -13,7 +15,19 @@ public class AppTest {
*/
@Test
public void testMain() {
// App.main(null);
}

// 第1个用户名正确,23都错误
String username1 = "weixin_41287260";
String username2 = "weixin_412872";
String username3 = "weixin_";

String[] usernames = {username1, username2, username3};
for (String username : usernames) {

// System.setIn(InputStream in) :重新分配“标准”输入流。
System.setIn(new ByteArrayInputStream(username.getBytes()));
App.main(null);
}

}
}

0 comments on commit d62fa11

Please sign in to comment.