Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#170) Organizations test #178

Merged
merged 39 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
77a86db
(#170) Application: Commands handlers tests
May 25, 2024
1fe90d7
(#170) Application: Omiting Dto in code covrege
May 25, 2024
de6a402
(#170) Application: Events external handlers tests
May 25, 2024
8c5a33d
(#170) Core: Etities AggregatedId an Organizations tests
May 25, 2024
de1ca65
(#170) IdentityContext assebly fix
May 25, 2024
7207093
(#170) IdentityContext assebly another fix
May 25, 2024
5a04eb0
Add like handler test
May 19, 2024
9032e88
Create comment Handler Tests
May 19, 2024
d48c608
delete Comment and Like Handler tests
May 19, 2024
f058570
ubdate comment Handler test
May 19, 2024
ff44767
external Handlers Tests
May 19, 2024
47ed7aa
(#148) core entity comment tests
May 19, 2024
94965c7
(#148) core enttity AggregatedId Tests
May 19, 2024
378e8c7
(#148) infrastructure service MessageBroker Tests
May 19, 2024
9901f55
(#148) udpate the build test script
SaintAngeLs May 20, 2024
37aa37d
(#148) udpate the incorrect project directory
SaintAngeLs May 20, 2024
26f0399
(#148) udpat the script
SaintAngeLs May 20, 2024
ff7fdf9
(#148) Infrastucture: removing mongo database and decorators from tes…
May 25, 2024
fde97c3
(#148) Core: excluding wrapers from core tests
May 25, 2024
e4bc2d5
(#148) Application: excluding dto from application tests range
May 25, 2024
2e2c6c1
(#148) Infrastucture: excluding logger related files from Infrastruct…
May 25, 2024
6337fde
(#148) update the build-tests script, update tesct coverage statistic…
SaintAngeLs May 25, 2024
66ac9d1
(#148) updat ebuild microserices
SaintAngeLs May 25, 2024
9d38d42
(#148) udpate the history depth checkout
SaintAngeLs May 25, 2024
49b3dad
(#148) specifying base commit
SaintAngeLs May 25, 2024
6511d51
(#148) adding the fail ci if error
SaintAngeLs May 25, 2024
9770124
(#148) adding the fail ci if error
SaintAngeLs May 25, 2024
7bfebab
(#148) ujdpate test script
SaintAngeLs May 25, 2024
2590916
(#148) ujdpate test script
SaintAngeLs May 25, 2024
4ba35b9
(#170) testing script update
SaintAngeLs May 25, 2024
88064d9
(#170) testing script update 2
SaintAngeLs May 25, 2024
1e528ff
(#170) update the deployment script
SaintAngeLs May 25, 2024
59e8585
(#170) Application: excluding queries
May 26, 2024
56d73af
(#170) Infrastucture: excluding decorators, loggers and extentions
May 26, 2024
e8e815a
(#170) Infrastructure: excluding mongo
May 26, 2024
140056e
(#170) Infrastructure: contest and services exclusion
May 26, 2024
110eb95
Merge branch 'dev' into organizations_test
eggwhat May 26, 2024
23d45df
(#170) add tests to solution
eggwhat May 26, 2024
fe2c1f7
Merge branch 'dev' into organizations_test
eggwhat May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build_microservices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
test_dir: 'MiniSpace.Services.Posts/tests'
- project: 'MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Api'
test_dir: 'MiniSpace.Services.Comments/tests'
- project: 'MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Api'
test_dir: 'MiniSpace.Services.Organizations/tests'
- project: 'MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Api'
test_dir: 'MiniSpace.Services.Posts/tests'
- project: 'MiniSpace.Web/src/MiniSpace.Web'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniSpace.Services.Organiza
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniSpace.Services.Organizations.Infrastructure", "src\MiniSpace.Services.Organizations.Infrastructure\MiniSpace.Services.Organizations.Infrastructure.csproj", "{3C5F46E5-9CF0-4A0A-AF56-9F1D455E7D1D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D697BE2B-E69A-40FF-9A78-0BB96CF4E6DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniSpace.Services.Organizations.Application.UnitTests", "tests\MiniSpace.Services.Organizations.Application.UnitTests\MiniSpace.Services.Organizations.Application.UnitTests.csproj", "{5CCAF099-8250-4DC6-AB75-95E35C9C91B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniSpace.Services.Organizations.Core.UnitTests", "tests\MiniSpace.Services.Organizations.Core.UnitTests\MiniSpace.Services.Organizations.Core.UnitTests.csproj", "{FBE0DFB5-3945-4A9E-B4A0-C3BED6C74726}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -38,11 +44,21 @@ Global
{3C5F46E5-9CF0-4A0A-AF56-9F1D455E7D1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C5F46E5-9CF0-4A0A-AF56-9F1D455E7D1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C5F46E5-9CF0-4A0A-AF56-9F1D455E7D1D}.Release|Any CPU.Build.0 = Release|Any CPU
{5CCAF099-8250-4DC6-AB75-95E35C9C91B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CCAF099-8250-4DC6-AB75-95E35C9C91B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CCAF099-8250-4DC6-AB75-95E35C9C91B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CCAF099-8250-4DC6-AB75-95E35C9C91B3}.Release|Any CPU.Build.0 = Release|Any CPU
{FBE0DFB5-3945-4A9E-B4A0-C3BED6C74726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBE0DFB5-3945-4A9E-B4A0-C3BED6C74726}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBE0DFB5-3945-4A9E-B4A0-C3BED6C74726}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBE0DFB5-3945-4A9E-B4A0-C3BED6C74726}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D8843565-EA51-407D-9F3B-BC0741B104A0} = {9A2329ED-4000-46C9-B9CD-956F6DA767CB}
{299EC532-840F-4ED9-A98F-CDC7C4DD315E} = {9A2329ED-4000-46C9-B9CD-956F6DA767CB}
{550E45D1-9BE7-4AE1-BA82-DDF57F436BEB} = {9A2329ED-4000-46C9-B9CD-956F6DA767CB}
{3C5F46E5-9CF0-4A0A-AF56-9F1D455E7D1D} = {9A2329ED-4000-46C9-B9CD-956F6DA767CB}
{5CCAF099-8250-4DC6-AB75-95E35C9C91B3} = {D697BE2B-E69A-40FF-9A78-0BB96CF4E6DA}
{FBE0DFB5-3945-4A9E-B4A0-C3BED6C74726} = {D697BE2B-E69A-40FF-9A78-0BB96CF4E6DA}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Collections;
using MiniSpace.Services.Organizations.Core.Entities;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Application.DTO
{
[ExcludeFromCodeCoverage]
public class OrganizationDetailsDto
{
public Guid Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using MiniSpace.Services.Organizations.Core.Entities;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Application.DTO
{
[ExcludeFromCodeCoverage]
public class OrganizationDto
{
public Guid Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Convey.CQRS.Queries;
using MiniSpace.Services.Organizations.Application.DTO;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Application.Queries
{
[ExcludeFromCodeCoverage]
public class GetAllChildrenOrganizations: IQuery<IEnumerable<Guid>>
{
public Guid OrganizationId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Convey.CQRS.Queries;
using MiniSpace.Services.Organizations.Application.DTO;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Application.Queries
{
[ExcludeFromCodeCoverage]
public class GetChildrenOrganizations: IQuery<IEnumerable<OrganizationDto>>
{
public Guid OrganizationId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Convey.CQRS.Queries;
using MiniSpace.Services.Organizations.Application.DTO;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Application.Queries
{
[ExcludeFromCodeCoverage]
public class GetOrganization : IQuery<OrganizationDto>
{
public Guid OrganizationId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Convey.CQRS.Queries;
using MiniSpace.Services.Organizations.Application.DTO;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Application.Queries
{
[ExcludeFromCodeCoverage]
public class GetOrganizationDetails : IQuery<OrganizationDetailsDto>
{
public Guid OrganizationId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
using Convey.CQRS.Queries;
using MiniSpace.Services.Organizations.Application.DTO;
using System.Diagnostics.CodeAnalysis;


namespace MiniSpace.Services.Organizations.Application.Queries
{
[ExcludeFromCodeCoverage]

public class GetOrganizerOrganizations: IQuery<IEnumerable<OrganizationDto>>
{

public Guid OrganizerId { get; set; }
public Guid RootId { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using Convey.CQRS.Queries;
using MiniSpace.Services.Organizations.Application.DTO;
using System.Diagnostics.CodeAnalysis;


namespace MiniSpace.Services.Organizations.Application.Queries
{
[ExcludeFromCodeCoverage]
public class GetRootOrganizations: IQuery<IEnumerable<OrganizationDto>>
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using MiniSpace.Services.Organizations.Application;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.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.Organizations.Application;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.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,5 +1,8 @@
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Contexts
{
[ExcludeFromCodeCoverage]
internal class CorrelationContext
{
public string CorrelationId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using MiniSpace.Services.Organizations.Application;
using System.Runtime.CompilerServices;
using System.Diagnostics.CodeAnalysis;

[assembly: InternalsVisibleTo("MiniSpace.Services.Organizations.Application.UnitTests")]

namespace MiniSpace.Services.Organizations.Infrastructure.Contexts
{
[ExcludeFromCodeCoverage]
internal class IdentityContext : IIdentityContext
{
public Guid Id { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
using Convey.MessageBrokers;
using Convey.MessageBrokers.Outbox;
using Convey.Types;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Decorators
{
[Decorator]
[ExcludeFromCodeCoverage]
internal sealed class OutboxCommandHandlerDecorator<TCommand> : ICommandHandler<TCommand>
where TCommand : class, ICommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
using Convey.MessageBrokers;
using Convey.MessageBrokers.Outbox;
using Convey.Types;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Decorators
{
[Decorator]
[ExcludeFromCodeCoverage]
internal sealed class OutboxEventHandlerDecorator<TEvent> : IEventHandler<TEvent>
where TEvent : class, IEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
// using MiniSpace.Services.Organizations.Application.Events.External;
// using MiniSpace.Services.Organizations.Application.Exceptions;
// using MiniSpace.Services.Organizations.Core;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.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
Expand Up @@ -4,9 +4,11 @@
using Convey.WebApi.Exceptions;
using MiniSpace.Services.Organizations.Application.Exceptions;
using MiniSpace.Services.Organizations.Core.Exceptions;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.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 @@ -39,9 +39,11 @@
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Repositories;
using MiniSpace.Services.Organizations.Infrastructure.Services;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.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
Expand Up @@ -2,9 +2,11 @@
using Convey.Logging.CQRS;
using Microsoft.Extensions.DependencyInjection;
using MiniSpace.Services.Organizations.Application.Commands;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Logging
{
[ExcludeFromCodeCoverage]
internal static class Extensions
{
public static IConveyBuilder AddHandlersLogging(this IConveyBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Convey.Logging.CQRS;
using MiniSpace.Services.Organizations.Application.Commands;
using MiniSpace.Services.Organizations.Application.Events.External;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Logging
{
[ExcludeFromCodeCoverage]
internal sealed class MessageToLogTemplateMapper : IMessageToLogTemplateMapper
{
private static IReadOnlyDictionary<Type, HandlerLogTemplate> MessageTemplates
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using MiniSpace.Services.Organizations.Application.DTO;
using MiniSpace.Services.Organizations.Core.Entities;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents
{
[ExcludeFromCodeCoverage]

public static class Extensions
{
public static Organization AsEntity(this OrganizationDocument document)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using Convey.Types;
using MiniSpace.Services.Organizations.Core.Entities;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents
{
[ExcludeFromCodeCoverage]

public class OrganizationDocument: IIdentifiable<Guid>
{
public Guid Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Convey.Types;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents
{
[ExcludeFromCodeCoverage]
public class OrganizerDocument : IIdentifiable<Guid>
{
public Guid Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using MiniSpace.Services.Organizations.Application.Queries;
using MiniSpace.Services.Organizations.Core.Entities;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
public class GetAllChildrenOrganizationsHandler : IQueryHandler<GetAllChildrenOrganizations, IEnumerable<Guid>>
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using MiniSpace.Services.Organizations.Application.Queries;
using MiniSpace.Services.Organizations.Core.Entities;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
public class GetChildrenOrganizationsHandler : IQueryHandler<GetChildrenOrganizations, IEnumerable<OrganizationDto>>
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
using MiniSpace.Services.Organizations.Application.Queries;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using MongoDB.Driver;
using System.Diagnostics.CodeAnalysis;


namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
public class GetOrganizationDetailsHandler : IQueryHandler<GetOrganizationDetails, OrganizationDetailsDto>
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
using MiniSpace.Services.Organizations.Application.DTO;
using MiniSpace.Services.Organizations.Application.Queries;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;


namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
public class GetOrganizationHandler : IQueryHandler<GetOrganization, OrganizationDto>
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
using MiniSpace.Services.Organizations.Application.Queries;
using MiniSpace.Services.Organizations.Core.Entities;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
public class GetOrganizerOrganizationsHandler : IQueryHandler<GetOrganizerOrganizations, IEnumerable<OrganizationDto>>
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using MiniSpace.Services.Organizations.Application.DTO;
using MiniSpace.Services.Organizations.Application.Queries;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Queries.Handlers
{
[ExcludeFromCodeCoverage]
public class GetRootOrganizationsHandler : IQueryHandler<GetRootOrganizations, IEnumerable<OrganizationDto>>
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using MiniSpace.Services.Organizations.Core.Entities;
using MiniSpace.Services.Organizations.Core.Repositories;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Repositories
{
[ExcludeFromCodeCoverage]
public class OrganizationMongoRepository : IOrganizationRepository
{
private readonly IMongoRepository<OrganizationDocument, Guid> _repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using MiniSpace.Services.Organizations.Core.Entities;
using MiniSpace.Services.Organizations.Core.Repositories;
using MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents;
using System.Diagnostics.CodeAnalysis;

namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Repositories
{
[ExcludeFromCodeCoverage]
public class OrganizerMongoRepository : IOrganizerRepository
{
private readonly IMongoRepository<OrganizerDocument, Guid> _repository;
Expand Down
Loading
Loading