1

当我编写与此类似的代码时,ReSharper 会很好地安排我的代码布局,直到我的一个测试(It should_...)需要被包装到第二行。突然,ReSharper 然后在测试上方和下方放置了一个空行,如下所示:

It should_have_the_expected_target_position = () => Focuser.CurrentStatus.TargetPositionInSteps.ShouldEqual(0);
It should_be_moving = () => Focuser.CurrentStatus.Moving.ShouldBeTrue();
It should_not_be_homing = () => Focuser.CurrentStatus.Homing.ShouldBeFalse();
It should_be_homed = () => Focuser.CurrentStatus.Homed.ShouldBeTrue();

It should_have_a_temperature_probe_attached =
    () => Focuser.CurrentStatus.TemperatureProbeDetected.ShouldBeTrue();

It should_not_have_remote_io = () => Focuser.CurrentStatus.RemoteInOutControllerDetected.ShouldBeFalse();
It should_not_have_a_hand_controller = () => Focuser.CurrentStatus.HandControllerDetected.ShouldBeFalse();

在我看来,这看起来有点“不干净”。如何消除空白行?我希望最终结果看起来像这样:

It should_have_the_expected_target_position = () => Focuser.CurrentStatus.TargetPositionInSteps.ShouldEqual(0);
It should_be_moving = () => Focuser.CurrentStatus.Moving.ShouldBeTrue();
It should_not_be_homing = () => Focuser.CurrentStatus.Homing.ShouldBeFalse();
It should_be_homed = () => Focuser.CurrentStatus.Homed.ShouldBeTrue();
It should_have_a_temperature_probe_attached =
    () => Focuser.CurrentStatus.TemperatureProbeDetected.ShouldBeTrue();
It should_not_have_remote_io = () => Focuser.CurrentStatus.RemoteInOutControllerDetected.ShouldBeFalse();
It should_not_have_a_hand_controller = () => Focuser.CurrentStatus.HandControllerDetected.ShouldBeFalse();

我正在使用 ReSharper 8.1。

4

0 回答 0