Skip to content

Commit

Permalink
Refactor calsses (#96)
Browse files Browse the repository at this point in the history
* fix(refactor) : refactor all class

* fix(refactor) : refactor all test class

* fix(Analyze data) : refactor all class
  • Loading branch information
mahdijafariii authored Sep 7, 2024
1 parent cd049f1 commit a92331e
Show file tree
Hide file tree
Showing 236 changed files with 1,328 additions and 1,298 deletions.
14 changes: 4 additions & 10 deletions AnalysisData/AnalysisData.sln.DotSettings.user
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=4036527e_002D1256_002D400e_002D9592_002Dd58dfbe85769/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="All tests from &amp;lt;TestProject&amp;gt;" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\amir\Desktop\New folder (4)\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=57d88556_002Dabe9_002D4ba5_002Da041_002D358ccf783382/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="AddFileToDb_ShouldReturnCategoryId_WhenCategoryIdAdded" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=57d88556_002Dabe9_002D4ba5_002Da041_002D358ccf783382/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="AddFileToDb_ShouldReturnCategoryId_WhenCategoryIdAdded" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\Mahdi\Desktop\New folder (2)\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=580d1d66_002D6a9d_002D41c5_002D9bbc_002D4f090dd2983a/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="GetAllNodesAsync_ShouldReturnsPaginatedNodes_WhenNodesExist #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
Expand Down Expand Up @@ -65,7 +65,6 @@
&lt;TestId&gt;xUnit::9AEC1F3F-B1B3-47C1-82D4-E432E2D77E0E::net8.0::TestProject.User.Services.UserService.BuisinessTests.PasswordManagerTests.ResetPasswordAsync_ShouldCallValidatePasswordAndConfirmation_WhenCalled&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=826a2c7b_002D653f_002D4c68_002D93e1_002Db3cd3a5e8b15/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="AccessFileToUserAsync_ShouldAccessFilesToInputUsers_WhenFileAndUserExist #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=7daf18b0_002D56cf_002D4c0c_002Da004_002D0da528af25ea/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="CheckExistenceOfRole_ShouldNotThrowException_WhenRoleExists" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;xUnit::9AEC1F3F-B1B3-47C1-82D4-E432E2D77E0E::net8.0::TestProject.mahdiTest2.FilePermissionService.FilePermissionServiceTest&lt;/TestId&gt;&#xD;
Expand Down Expand Up @@ -139,16 +138,11 @@
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ce35ecc6_002D100e_002D4f4e_002Daba0_002D7678c76dbbbe/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="DeleteRole_ShouldRemovesRoleAndReturnsTrue_WhenRoleExists" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\Mahdi\Desktop\New folder (2)\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fe4fe44b_002D7953_002D4423_002Dac04_002Da7f1b464e5c0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="ResetPasswordAsync_ShouldCallPasswordCheck_WhenCalled" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fe4fe44b_002D7953_002D4423_002Dac04_002Da7f1b464e5c0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="ResetPasswordAsync_ShouldCallPasswordCheck_WhenCalled" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\Mahdi\Desktop\New folder (2)\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ff0aa496_002Df562_002D44d7_002Db40c_002D780e81cc354b/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="All tests from &amp;lt;TestProject&amp;gt; #2" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\Mahdi\Desktop\New folder (2)\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;xUnit::9AEC1F3F-B1B3-47C1-82D4-E432E2D77E0E::net8.0::TestProject.Graph.Service.GraphServices.AllNodesData.NodePaginationServiceTests&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>

<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=AnalysisData_002FResources/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/OrderByFullPath/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/ShowComments/@EntryValue">False</s:Boolean></s:String></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/ResxEditorPersonal/ShowComments/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
6 changes: 5 additions & 1 deletion AnalysisData/AnalysisData/AnalysisData.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
</ItemGroup>

<ItemGroup>
<Folder Include="User\" />
<Folder Include="Dtos\" />
<Folder Include="Models\" />
<Folder Include="Repositories\" />
<Folder Include="Repositories\GraphRepositories\GraphRepository\" />
<Folder Include="Services\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion AnalysisData/AnalysisData/Authorization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace AnalysisData;

public class Authorization
{
public async Task ConfigureAuthorizationPolicies(IServiceCollection services)
public void ConfigureAuthorizationPolicies(IServiceCollection services)
{
services.AddAuthorization(options =>
{
Expand Down
144 changes: 77 additions & 67 deletions AnalysisData/AnalysisData/ConfigService.cs
Original file line number Diff line number Diff line change
@@ -1,57 +1,70 @@
using System.Globalization;
using AnalysisData.Graph.Service.ServiceBusiness;
using AnalysisData.Graph.Service.ServiceBusiness.Abstraction;
using AnalysisData.Graph.Repository.CategoryRepository;
using AnalysisData.Graph.Repository.CategoryRepository.Abstraction;
using AnalysisData.Graph.Repository.EdgeRepository;
using AnalysisData.Graph.Repository.EdgeRepository.Abstraction;
using AnalysisData.Graph.Repository.FileUploadedRepository;
using AnalysisData.Graph.Repository.FileUploadedRepository.Abstraction;
using AnalysisData.Graph.Repository.GraphEdgeRepository;
using AnalysisData.Graph.Repository.GraphNodeRepository;
using AnalysisData.Graph.Repository.NodeRepository;
using AnalysisData.Graph.Repository.NodeRepository.Abstraction;
using AnalysisData.Graph.Repository.UserFileRepository;
using AnalysisData.Graph.Repository.UserFileRepository.Abstraction;
using AnalysisData.Graph.Service.CategoryService;
using AnalysisData.Graph.Service.CategoryService.Abstraction;
using AnalysisData.Graph.Service.FilePermissionService;
using AnalysisData.Graph.Service.FilePermissionService.AccessManagement;
using AnalysisData.Graph.Service.FileUploadService;
using AnalysisData.Graph.Service.FileUploadService.Abstraction;
using AnalysisData.Graph.Service.GraphServices.AllNodesData;
using AnalysisData.Graph.Service.GraphServices.AllNodesData.Abstraction;
using AnalysisData.Graph.Service.GraphServices.NodeAndEdgeInfo;
using AnalysisData.Graph.Service.GraphServices.NodeAndEdgeInfo.Abstraction;
using AnalysisData.Graph.Service.GraphServices.Relationship;
using AnalysisData.Graph.Service.GraphServices.Relationship.Abstraction;
using AnalysisData.Graph.Service.GraphServices.Search;
using AnalysisData.Graph.Service.GraphServices.Search.Abstraction;
using AnalysisData.User.CookieService;
using AnalysisData.User.CookieService.abstractions;
using AnalysisData.User.JwtService.abstractions;
using AnalysisData.User.Repository.PasswordResetTokensRepository;
using AnalysisData.User.Repository.PasswordResetTokensRepository.Abstraction;
using AnalysisData.User.Repository.RoleRepository;
using AnalysisData.User.Repository.RoleRepository.Abstraction;
using AnalysisData.User.Repository.UserRepository;
using AnalysisData.User.Repository.UserRepository.Abstraction;
using AnalysisData.User.Services.AdminService;
using AnalysisData.User.Services.AdminService.Abstraction;
using AnalysisData.User.Services.EmailService;
using AnalysisData.User.Services.PermissionService;
using AnalysisData.User.Services.PermissionService.Abstraction;
using AnalysisData.User.Services.RoleService;
using AnalysisData.User.Services.RoleService.Abstraction;
using AnalysisData.User.Services.S3FileStorageService;
using AnalysisData.User.Services.S3FileStorageService.Abstraction;
using AnalysisData.User.Services.SecurityPasswordService;
using AnalysisData.User.Services.SecurityPasswordService.Abstraction;
using AnalysisData.User.Services.TokenService.Abstraction;
using AnalysisData.User.Services.UserService.Abstraction;
using AnalysisData.User.Services.UserService.Business;
using AnalysisData.User.Services.ValidationService;
using AnalysisData.User.Services.ValidationService.Abstraction;
using AnalysisData.Repositories.GraphRepositories.CategoryRepository;
using AnalysisData.Repositories.GraphRepositories.CategoryRepository.Abstraction;
using AnalysisData.Repositories.GraphRepositories.FileUploadedRepository;
using AnalysisData.Repositories.GraphRepositories.FileUploadedRepository.Abstraction;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.EdgeRepository;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.EdgeRepository.Abstraction;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.GraphEdgeRepository;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.GraphEdgeRepository.Abstraction;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.GraphNodeRepository;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.GraphNodeRepository.Abstraction;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.NodeRepository;
using AnalysisData.Repositories.GraphRepositories.GraphRepository.NodeRepository.Abstraction;
using AnalysisData.Repositories.GraphRepositories.UserFileRepository;
using AnalysisData.Repositories.GraphRepositories.UserFileRepository.Abstraction;
using AnalysisData.Repositories.PasswordResetTokensRepository;
using AnalysisData.Repositories.PasswordResetTokensRepository.Abstraction;
using AnalysisData.Repositories.RoleRepository;
using AnalysisData.Repositories.RoleRepository.Abstraction;
using AnalysisData.Repositories.UserRepository;
using AnalysisData.Repositories.UserRepository.Abstraction;
using AnalysisData.Services.CookieService;
using AnalysisData.Services.CookieService.Abstractions;
using AnalysisData.Services.EmailService;
using AnalysisData.Services.EmailService.Abstraction;
using AnalysisData.Services.GraphService.Business.CsvManager;
using AnalysisData.Services.GraphService.Business.CsvManager.Abstractions;
using AnalysisData.Services.GraphService.Business.CsvManager.CsvHeaderManager;
using AnalysisData.Services.GraphService.Business.CsvManager.CsvHeaderManager.Abstractions;
using AnalysisData.Services.GraphService.Business.EdgeManager;
using AnalysisData.Services.GraphService.Business.EdgeManager.Abstractions;
using AnalysisData.Services.GraphService.Business.NodeManager;
using AnalysisData.Services.GraphService.Business.NodeManager.Abstraction;
using AnalysisData.Services.GraphService.CategoryService;
using AnalysisData.Services.GraphService.CategoryService.Abstraction;
using AnalysisData.Services.GraphService.FilePermissionService;
using AnalysisData.Services.GraphService.FilePermissionService.Abstractions;
using AnalysisData.Services.GraphService.FilePermissionService.AccessManagement;
using AnalysisData.Services.GraphService.FilePermissionService.AccessManagement.Abstractions;
using AnalysisData.Services.GraphService.FileUploadService;
using AnalysisData.Services.GraphService.FileUploadService.Abstraction;
using AnalysisData.Services.GraphService.GraphServices.AllNodesData;
using AnalysisData.Services.GraphService.GraphServices.AllNodesData.Abstraction;
using AnalysisData.Services.GraphService.GraphServices.NodeAndEdgeInfo;
using AnalysisData.Services.GraphService.GraphServices.NodeAndEdgeInfo.Abstraction;
using AnalysisData.Services.GraphService.GraphServices.Relationship;
using AnalysisData.Services.GraphService.GraphServices.Relationship.Abstraction;
using AnalysisData.Services.GraphService.GraphServices.Search;
using AnalysisData.Services.GraphService.GraphServices.Search.Abstraction;
using AnalysisData.Services.JwtService;
using AnalysisData.Services.JwtService.Abstraction;
using AnalysisData.Services.PermissionService;
using AnalysisData.Services.PermissionService.Abstraction;
using AnalysisData.Services.RoleService;
using AnalysisData.Services.RoleService.Abstraction;
using AnalysisData.Services.S3FileStorageService;
using AnalysisData.Services.S3FileStorageService.Abstraction;
using AnalysisData.Services.TokenService;
using AnalysisData.Services.TokenService.Abstraction;
using AnalysisData.Services.UserService.AdminService;
using AnalysisData.Services.UserService.AdminService.Abstraction;
using AnalysisData.Services.UserService.UserService;
using AnalysisData.Services.UserService.UserService.Abstraction;
using AnalysisData.Services.UserService.UserService.Business;
using AnalysisData.Services.UserService.UserService.Business.Abstraction;
using AnalysisData.Services.ValidationService;
using AnalysisData.Services.ValidationService.Abstraction;
using CsvHelper;
using CsvHelper.Configuration;

Expand Down Expand Up @@ -90,22 +103,22 @@ public static IServiceCollection AddServices(this IServiceCollection services)
var textReader = new StringReader("");
return new CsvReader(textReader, config);
});
services.AddScoped<ICsvReader, CsvReaderWrapper>();
services.AddScoped<ICsvReaderService, CsvReaderService>();
services.AddScoped<IHeaderValidator, HeaderValidator>();
services.AddScoped<ICsvHeaderReader, CsvHeaderReader>();
services.AddScoped<IEdgeToDbService, EdgeToDbService>();
services.AddScoped<ICsvReaderProcessor, CsvReaderProcessorProcessor>();
services.AddScoped<ICsvReaderManager, CsvReaderManager>();
services.AddScoped<IHeaderValidatorProcessor, HeaderValidatorProcessorProcessor>();
services.AddScoped<ICsvHeaderReaderProcessor, CsvHeaderReaderProcessor>();
services.AddScoped<IEdgeToDbProcessor, EdgeToDbProcessor>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IJwtService, JwtService>();
services.AddScoped<ICookieService, CookieService>();
services.AddScoped<IPermissionService, PermissionService>();
services.AddScoped<IValidationService, ValidationService>();
services.AddScoped<ILoginManager, LoginManager>();
services.AddScoped<INodeToDbService, NodeToDbService>();
services.AddScoped<INodeToDbProcessor, NodeToDbProcessor>();
services.AddScoped<IUserManager, UserManager>();
services.AddScoped<IPasswordManager, PasswordManager>();
services.AddScoped<IHeaderProcessor, HeaderProcessor>();
services.AddScoped<IPasswordService, PasswordService>();
services.AddScoped<IHeaderProcessor, HeaderProcessor>();
services.AddScoped<IValidtionPasswordManager, ValidationPasswordManager>();
services.AddScoped<INodeRecordProcessor, EntityNodeRecordProcessor>();
services.AddScoped<IFromToProcessor, FromToProcessor>();
services.AddScoped<INodePaginationService, NodePaginationService>();
Expand All @@ -119,19 +132,16 @@ public static IServiceCollection AddServices(this IServiceCollection services)
services.AddScoped<IRoleManagementService, RoleManagementService>();
services.AddScoped<IAccessManagementService, AccessManagementService>();
services.AddScoped<IAdminRegisterService, AdminRegisterService>();
services.AddScoped<IPasswordHasher, PasswordHasher>();
services.AddScoped<IPasswordHasherManager, PasswordHasherManager>();
services.AddScoped<IS3FileStorageService, S3FileStorageService>();
services.AddScoped<IUploadImageService, UploadImageService>();
services.AddScoped<IValueNodeProcessor, ValueNodeProcessor>();
services.AddScoped<IEntityEdgeRecordProcessor, EntityEdgeRecordProcessor>();
services.AddScoped<IValueEdgeProcessor, ValueEdgeProcessor>();
services.AddScoped<IEdgeToDbService, EdgeToDbService>();
services.AddScoped<IEdgeToDbProcessor, EdgeToDbProcessor>();
services.AddScoped<IEmailService, EmailService>();
services.AddScoped<IResetPasswordService, ResetPasswordService>();
services.AddScoped<IResetPasswordRequestService, ResetPasswordRequestService>();
services.AddScoped<IValidateTokenService, ValidateTokenService>();



return services;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AnalysisData.Graph.Dto.CategoryDto;
using AnalysisData.Graph.Service.CategoryService.Abstraction;
using AnalysisData.Dtos.GraphDto.CategoryDto;
using AnalysisData.Services.GraphService.CategoryService.Abstraction;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace AnalysisData.Graph.Controllers;
namespace AnalysisData.Controllers.GraphController;

[ApiController]
[Route("api/[controller]")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AnalysisData.Graph.Dto;
using AnalysisData.Graph.Repository.UserFileRepository.Abstraction;
using AnalysisData.Graph.Service.FilePermissionService;
using AnalysisData.Dtos.GraphDto.FileDto;
using AnalysisData.Repositories.GraphRepositories.UserFileRepository.Abstraction;
using AnalysisData.Services.GraphService.FilePermissionService.Abstractions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace AnalysisData.Graph.Controllers;
namespace AnalysisData.Controllers.GraphController;

[ApiController]
[Route("api/[controller]")]
Expand Down
Loading

0 comments on commit a92331e

Please sign in to comment.