在IntelliJ Idea中,在创建测试时是否有一种自动扩展类的方式?

huangapple 未分类评论51阅读模式
英文:

Is there a way in Intellj Idea to automatically extend a class while creating a Test?

问题

在我创建关于IntelliJ IDEA的测试类时,我希望直接扩展基本的测试类。

应该看起来像这样:

是否有一种方法可以在创建测试时直接扩展BaseTest类?我在设置和网络中搜索过,但没有找到。

英文:

When I create a test class about intellj Idea I would like to extend the basic test class directly.

在IntelliJ Idea中,在创建测试时是否有一种自动扩展类的方式?

Should look like this:

在IntelliJ Idea中,在创建测试时是否有一种自动扩展类的方式?

is there a way to set that the BaseTest class is extended directly when creating a test? i have searched in the settings and the net but could not find it.

答案1

得分: 0

好的,以下是翻译好的内容:

IntelliJ的美妙之处在于,当你找不到任何快捷键时,你可以自己创建。

进入设置 ctrl+alt+s,然后搜索live templates。

选择你偏好的语言,通过参考已经可用的默认快捷键来创建你自己的快捷键。

Ctrl+shift+t是创建当前类的测试的快捷键。你可以根据自己的需要进行修改。

如果你有疑问,明天早上当我打开我的笔记本电脑时,我会给你一个适合你情况的。

英文:

Well, it is beauty of IntelliJ that when you can’t find any shortcut you can create your own.

Go to settings ctrl+alt+s and search for live templates.

Select your preferred language and create your own shortcut by referring already available default shortcut.

Ctrl+shift+t is shortcut to create test of current class. You can modify that per your use.

If you have some doubt, tomorrow morning I will give you one for your case when I turn my laptop on.

huangapple
  • 本文由 发表于 2020年5月5日 19:08:28
  • 转载请务必保留本文链接:https://java.coder-hub.com/61611712.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定