Skip to content

Commit

Permalink
(#188) Infrastructure: add test coverage exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkiprik committed May 26, 2024
1 parent 12a37e4 commit 3d3fe77
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Convey.Auth;
using MiniSpace.Services.Identity.Application.DTO;
using MiniSpace.Services.Identity.Application.Services;

namespace MiniSpace.Services.Identity.Infrastructure.Auth
{
[ExcludeFromCodeCoverage]
public class JwtProvider : IJwtProvider
{
private readonly IJwtHandler _jwtHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.Identity;
using MiniSpace.Services.Identity.Application.Services;

namespace MiniSpace.Services.Identity.Infrastructure.Auth
{
[ExcludeFromCodeCoverage]
public class PasswordService : IPasswordService
{
private readonly IPasswordHasher<IPasswordService> _passwordHasher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Security.Cryptography;
using MiniSpace.Services.Identity.Application.Services;

namespace MiniSpace.Services.Identity.Infrastructure.Auth
{
[ExcludeFromCodeCoverage]
internal sealed class Rng : IRng
{
private static readonly string[] SpecialChars = new[] {"/", "\\", "=", "+", "?", ":", "&"};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Diagnostics.CodeAnalysis;
using MiniSpace.Services.Identity.Application;

namespace MiniSpace.Services.Identity.Infrastructure.Contexts
{
[ExcludeFromCodeCoverage]
internal class AppContext : IAppContext
{
public string RequestId { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using MiniSpace.Services.Identity.Application;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Identity.Infrastructure.Contexts
{
[ExcludeFromCodeCoverage]
internal sealed class AppContextFactory : IAppContextFactory
{
private readonly ICorrelationContextAccessor _contextAccessor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Identity.Infrastructure.Contexts
{
[ExcludeFromCodeCoverage]
internal class CorrelationContext
{
public string CorrelationId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using MiniSpace.Services.Identity.Application;

namespace MiniSpace.Services.Identity.Infrastructure.Contexts
{
[ExcludeFromCodeCoverage]
internal class IdentityContext : IIdentityContext
{
public Guid Id { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Convey.CQRS.Commands;
using Convey.MessageBrokers;
Expand All @@ -7,6 +8,7 @@

namespace MiniSpace.Services.Identity.Infrastructure.Decorators
{
[ExcludeFromCodeCoverage]
[Decorator]
internal sealed class OutboxCommandHandlerDecorator<TCommand> : ICommandHandler<TCommand>
where TCommand : class, ICommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Convey.CQRS.Events;
using Convey.MessageBrokers;
Expand All @@ -7,6 +8,7 @@

namespace MiniSpace.Services.Identity.Infrastructure.Decorators
{
[ExcludeFromCodeCoverage]
[Decorator]
internal sealed class OutboxEventHandlerDecorator<TEvent> : IEventHandler<TEvent>
where TEvent : class, IEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Convey.MessageBrokers.RabbitMQ;
using MiniSpace.Services.Identity.Application.Commands;
using MiniSpace.Services.Identity.Application.Events.Rejected;
using MiniSpace.Services.Identity.Core.Exceptions;

namespace MiniSpace.Services.Identity.Infrastructure.Exceptions
{
[ExcludeFromCodeCoverage]
internal sealed class ExceptionToMessageMapper : IExceptionToMessageMapper
{
public object Map(Exception exception, object message)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using Convey;
using Convey.WebApi.Exceptions;
Expand All @@ -8,6 +9,7 @@

namespace MiniSpace.Services.Identity.Infrastructure.Exceptions
{
[ExcludeFromCodeCoverage]
internal sealed class ExceptionToResponseMapper : IExceptionToResponseMapper
{
private static readonly ConcurrentDictionary<Type, string> Codes = new ConcurrentDictionary<Type, string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
using MiniSpace.Services.Identity.Infrastructure.Mongo.Documents;
using MiniSpace.Services.Identity.Infrastructure.Mongo.Repositories;
using MiniSpace.Services.Identity.Infrastructure.Services;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Identity.Infrastructure
{
[ExcludeFromCodeCoverage]
public static class Extensions
{
public static IConveyBuilder AddInfrastructure(this IConveyBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using MiniSpace.Services.Identity.Application;

namespace MiniSpace.Services.Identity.Infrastructure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using MiniSpace.Services.Identity.Application.DTO;
using MiniSpace.Services.Identity.Core.Entities;

namespace MiniSpace.Services.Identity.Infrastructure.Mongo.Documents
{
[ExcludeFromCodeCoverage]
internal static class Extensions
{
public static User AsEntity(this UserDocument document)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Convey.Types;

namespace MiniSpace.Services.Identity.Infrastructure.Mongo.Documents
{
[ExcludeFromCodeCoverage]
internal sealed class RefreshTokenDocument : IIdentifiable<Guid>
{
public Guid Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Convey.Types;

namespace MiniSpace.Services.Identity.Infrastructure.Mongo.Documents
{
[ExcludeFromCodeCoverage]
internal sealed class UserDocument : IIdentifiable<Guid>
{
public Guid Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Driver;
using MiniSpace.Services.Identity.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Identity.Infrastructure.Mongo
{
[ExcludeFromCodeCoverage]
public static class Extensions
{
public static IApplicationBuilder UseMongo(this IApplicationBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Convey.CQRS.Queries;
using Convey.Persistence.MongoDB;
Expand All @@ -8,6 +9,7 @@

namespace MiniSpace.Services.Identity.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
internal sealed class GetUserHandler : IQueryHandler<GetUser, UserDto>
{
private readonly IMongoRepository<UserDocument, Guid> _userRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Convey.Persistence.MongoDB;
using MiniSpace.Services.Identity.Core.Entities;
Expand All @@ -7,6 +8,7 @@

namespace MiniSpace.Services.Identity.Infrastructure.Mongo.Repositories
{
[ExcludeFromCodeCoverage]
internal sealed class RefreshTokenRepository : IRefreshTokenRepository
{
private readonly IMongoRepository<RefreshTokenDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Convey.Persistence.MongoDB;
using MiniSpace.Services.Identity.Core.Entities;
Expand All @@ -7,6 +8,7 @@

namespace MiniSpace.Services.Identity.Infrastructure.Mongo.Repositories
{
[ExcludeFromCodeCoverage]
internal sealed class UserRepository : IUserRepository
{
private readonly IMongoRepository<UserDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
using Microsoft.Extensions.Logging;
using OpenTracing;
using MiniSpace.Services.Identity.Application.Services;
using System.Diagnostics.CodeAnalysis;

[assembly: InternalsVisibleTo("MiniSpace.Services.Identity.Infrastructure.UnitTests")]
namespace MiniSpace.Services.Identity.Infrastructure.Services
{
[ExcludeFromCodeCoverage]
internal sealed class MessageBroker : IMessageBroker
{
private const string DefaultSpanContextHeader = "span_context";
Expand Down

0 comments on commit 3d3fe77

Please sign in to comment.