U:调整所有代码格式
This commit is contained in:
1 parent
d133bacf55
commit
155b67e831
342 files changed
+9431
-9868
No files matched your search
@@ -104,10 +104,7 @@ public class ExceptionExpandTests
|
||||
public void Scenario_UseInBusinessLogic()
|
||||
{
|
||||
// Act: 执行可能失败的业务操作
|
||||
var exception = Assert.ThrowsException<ExceptionExpand>(() =>
|
||||
{
|
||||
ProcessBusinessOperation(-1);
|
||||
});
|
||||
var exception = Assert.ThrowsException<ExceptionExpand>(() => { ProcessBusinessOperation(-1); });
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(4001L, exception.ErrorCode);
|
||||
@@ -132,10 +129,7 @@ public class ExceptionExpandTests
|
||||
);
|
||||
|
||||
// Act: 捕获并检查异常链
|
||||
var exception = Assert.ThrowsException<ExceptionExpand>(() =>
|
||||
{
|
||||
throw serviceException;
|
||||
});
|
||||
var exception = Assert.ThrowsException<ExceptionExpand>(() => { throw serviceException; });
|
||||
|
||||
// Assert: 验证异常链
|
||||
Assert.AreEqual(5001L, exception.ErrorCode);
|
||||
@@ -179,10 +173,7 @@ public class ExceptionExpandTests
|
||||
/// </summary>
|
||||
private void ProcessBusinessOperation(int userId)
|
||||
{
|
||||
if (userId <= 0)
|
||||
{
|
||||
throw new ExceptionExpand(4001L, "Invalid user ID", "User ID must be positive");
|
||||
}
|
||||
if (userId <= 0) throw new ExceptionExpand(4001L, "Invalid user ID", "User ID must be positive");
|
||||
|
||||
// 正常处理逻辑...
|
||||
}
|
||||
@@ -201,4 +192,4 @@ public class ExceptionExpandTests
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user