1

我在 teamcity 上使用 dotCover 并运行单元测试,但发现一些方法未包含在代码覆盖范围内(未以绿色或红色突出显示),如以下代码。
我可以在哪里更改此代码覆盖率?

           [Route("messages")]
26         [HttpGet]
27         [HandleException]
28         public async Task<GetMessagesResponse> GetMessagesAsync(string cultureCode)
29         {
30             var messages = await _messageApiProxy.GetMessagesAsync(cultureCode, _userContext.UserId);
31 
32             return new GetMessagesResponse
33             {
34                 Result = Succeeded,
35                 Messages = messages.Select(TransformToModelFrom).ToArray()
36             };
37         }
38 
39         [Route("messages/{messageId}/{status:int}")]
40         [HttpGet]
41         [HandleException]
42         public async Task<GetMessageDetailResponse> GetMessageAsync(string cultureCode, Guid messageId, int status)
43         {
44             var message = await _messageApiProxy.GetMessageAsync(cultureCode, _userContext.UserId, messageId, status);
45 
46             return new GetMessageDetailResponse
47             {
48                 Result = Succeeded,
49                 MessageInfo = TransformToModelFrom(message)
50             };
51         }
4

0 回答 0