Skip to content

Commit

Permalink
✅ Exclude from coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Marthijn van den Heuvel committed Aug 28, 2024
1 parent 190c6b8 commit dda09bb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Sidio.Sitemap.AspNetCore.Examples.MvcWebApplication.Middleware.Models;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace Sidio.Sitemap.AspNetCore.Examples.MvcWebApplication.Middleware.Controllers;

Expand Down Expand Up @@ -33,6 +34,7 @@ public IActionResult Privacy()
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[ExcludeFromCodeCoverage]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
namespace Sidio.Sitemap.AspNetCore.Examples.MvcWebApplication.Middleware.Models
using System.Diagnostics.CodeAnalysis;

namespace Sidio.Sitemap.AspNetCore.Examples.MvcWebApplication.Middleware.Models;

[ExcludeFromCodeCoverage]
public class ErrorViewModel
{
public class ErrorViewModel
{
public string? RequestId { get; set; }
public string? RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Mvc;
using Sidio.Sitemap.AspNetCore.Examples.MvcWebApplication.Models;

Expand All @@ -24,6 +25,7 @@ public IActionResult Privacy()
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[ExcludeFromCodeCoverage]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Diagnostics.CodeAnalysis;

namespace Sidio.Sitemap.AspNetCore.Examples.MvcWebApplication.Models;

[ExcludeFromCodeCoverage]
public class ErrorViewModel
{
public string? RequestId { get; set; }
Expand Down

0 comments on commit dda09bb

Please sign in to comment.