-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from eduardo-paes:development
Complete test implementation
- Loading branch information
Showing
132 changed files
with
6,716 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ActivityTypeMock | ||
{ | ||
public static ActivityType MockValidActivityType() | ||
{ | ||
return new ActivityType("Activity Type Name", "Activity Type Description", Guid.NewGuid()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class CampusMock | ||
{ | ||
public static Campus MockValidCampus() => new("Campus Name"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ClaimsMock | ||
{ | ||
public static Dictionary<Guid, Domain.Entities.User> MockValidClaims() => new() { { Guid.NewGuid(), UserMock.MockValidUser() } }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class CourseMock | ||
{ | ||
public static Course MockValidCourse() => new("Course Name"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Moq; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class FileMock | ||
{ | ||
public static IFormFile CreateIFormFile() | ||
{ | ||
// Create a mock IFormFile, you can adjust the implementation as needed. | ||
var fileMock = new Mock<IFormFile>(); | ||
fileMock.Setup(file => file.FileName).Returns("file.txt"); | ||
fileMock.Setup(file => file.Length).Returns(1024); | ||
// Add other setup as needed. | ||
return fileMock.Object; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class NoticeMock | ||
{ | ||
public static Notice MockValidNotice() => new( | ||
registrationStartDate: DateTime.UtcNow, | ||
registrationEndDate: DateTime.UtcNow.AddDays(7), | ||
evaluationStartDate: DateTime.UtcNow.AddDays(8), | ||
evaluationEndDate: DateTime.UtcNow.AddDays(14), | ||
appealStartDate: DateTime.UtcNow.AddDays(15), | ||
appealFinalDate: DateTime.UtcNow.AddDays(21), | ||
sendingDocsStartDate: DateTime.UtcNow.AddDays(22), | ||
sendingDocsEndDate: DateTime.UtcNow.AddDays(28), | ||
partialReportDeadline: DateTime.UtcNow.AddDays(29), | ||
finalReportDeadline: DateTime.UtcNow.AddDays(35), | ||
description: "Edital de teste", | ||
suspensionYears: 1 | ||
); | ||
|
||
public static Notice MockValidNoticeWithId() => new( | ||
id: Guid.NewGuid(), | ||
registrationStartDate: DateTime.UtcNow, | ||
registrationEndDate: DateTime.UtcNow.AddDays(7), | ||
evaluationStartDate: DateTime.UtcNow.AddDays(8), | ||
evaluationEndDate: DateTime.UtcNow.AddDays(14), | ||
appealStartDate: DateTime.UtcNow.AddDays(15), | ||
appealFinalDate: DateTime.UtcNow.AddDays(21), | ||
sendingDocsStartDate: DateTime.UtcNow.AddDays(22), | ||
sendingDocsEndDate: DateTime.UtcNow.AddDays(28), | ||
partialReportDeadline: DateTime.UtcNow.AddDays(29), | ||
finalReportDeadline: DateTime.UtcNow.AddDays(35), | ||
description: "Edital de teste", | ||
suspensionYears: 1 | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ProgramTypeMock | ||
{ | ||
public static ProgramType MockValidProgramType() => new("Program Name", "Program Description"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ProjectActivityMock | ||
{ | ||
public static ProjectActivity MockValidProjectActivity() => new(Guid.NewGuid(), Guid.NewGuid(), 5, 3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Domain.Entities; | ||
using Domain.Entities.Enums; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ProjectEvaluationMock | ||
{ | ||
public static ProjectEvaluation MockValidProjectEvaluation() => | ||
new( | ||
Guid.NewGuid(), | ||
true, | ||
Guid.NewGuid(), | ||
EProjectStatus.Accepted, | ||
DateTime.UtcNow, | ||
"Valid Submission Evaluation Description", | ||
EQualification.Doctor, | ||
EScore.Excellent, | ||
EScore.Excellent, | ||
EScore.Excellent, | ||
EScore.Excellent, | ||
10.0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ProjectFinalReportMock | ||
{ | ||
public static ProjectFinalReport MockValidProjectFinalReport() | ||
{ | ||
return new ProjectFinalReport(Guid.NewGuid(), Guid.NewGuid()) | ||
{ | ||
ReportUrl = "https://example.com/report", | ||
SendDate = DateTime.UtcNow | ||
}; | ||
} | ||
|
||
public static ProjectFinalReport MockValidProjectFinalReportWithId() | ||
{ | ||
return new ProjectFinalReport(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()) | ||
{ | ||
ReportUrl = "https://example.com/report", | ||
SendDate = DateTime.UtcNow | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
using Domain.Entities; | ||
using Domain.Entities.Enums; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class ProjectMock | ||
{ | ||
public static Project MockValidProject() => new( | ||
"Project Title", | ||
"Keyword 1", | ||
"Keyword 2", | ||
"Keyword 3", | ||
true, | ||
"Objective", | ||
"Methodology", | ||
"Expected Results", | ||
"Schedule", | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
EProjectStatus.Opened, | ||
"Status Description", | ||
"Appeal Observation", | ||
DateTime.UtcNow, | ||
DateTime.UtcNow, | ||
DateTime.UtcNow, | ||
"Cancellation Reason"); | ||
|
||
public static Project MockValidProjectWithId() => new( | ||
Guid.NewGuid(), | ||
"Project Title", | ||
"Keyword 1", | ||
"Keyword 2", | ||
"Keyword 3", | ||
true, | ||
"Objective", | ||
"Methodology", | ||
"Expected Results", | ||
"Schedule", | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
EProjectStatus.Opened, | ||
"Status Description", | ||
"Appeal Observation", | ||
DateTime.UtcNow, | ||
DateTime.UtcNow, | ||
DateTime.UtcNow, | ||
"Cancellation Reason"); | ||
|
||
public static Project MockValidProjectProfessorAndNotice() | ||
{ | ||
return new( | ||
Guid.NewGuid(), | ||
"Project Title", | ||
"Keyword 1", | ||
"Keyword 2", | ||
"Keyword 3", | ||
true, | ||
"Objective", | ||
"Methodology", | ||
"Expected Results", | ||
"Schedule", | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
Guid.NewGuid(), | ||
EProjectStatus.Opened, | ||
"Status Description", | ||
"Appeal Observation", | ||
DateTime.UtcNow, | ||
DateTime.UtcNow, | ||
DateTime.UtcNow, | ||
"Cancellation Reason") | ||
{ | ||
SubArea = new SubArea(Guid.NewGuid(), "SubArea Name", "SubArea Code"), | ||
ProgramType = new ProgramType("Program Type Name", "Program Type Description"), | ||
Professor = new Professor("1234567", 1234567) | ||
{ | ||
User = new User("Name", "[email protected]", "Password", "58411338029", ERole.ADMIN) | ||
}, | ||
Notice = new( | ||
id: Guid.NewGuid(), | ||
registrationStartDate: DateTime.UtcNow, | ||
registrationEndDate: DateTime.UtcNow.AddDays(7), | ||
evaluationStartDate: DateTime.UtcNow.AddDays(8), | ||
evaluationEndDate: DateTime.UtcNow.AddDays(14), | ||
appealStartDate: DateTime.UtcNow.AddDays(15), | ||
appealFinalDate: DateTime.UtcNow.AddDays(21), | ||
sendingDocsStartDate: DateTime.UtcNow.AddDays(22), | ||
sendingDocsEndDate: DateTime.UtcNow.AddDays(28), | ||
partialReportDeadline: DateTime.UtcNow.AddDays(29), | ||
finalReportDeadline: DateTime.UtcNow.AddDays(35), | ||
description: "Edital de teste", | ||
suspensionYears: 1 | ||
) | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Domain.Entities.Enums; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public class ProjectPartialReportMock | ||
{ | ||
public static Domain.Entities.ProjectPartialReport MockValidProjectPartialReport() | ||
{ | ||
return new Domain.Entities.ProjectPartialReport( | ||
projectId: Guid.NewGuid(), | ||
currentDevelopmentStage: 1, | ||
scholarPerformance: EScholarPerformance.Good, | ||
additionalInfo: "Additional Information", | ||
userId: Guid.NewGuid()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Domain.Entities.Enums; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class StudentMock | ||
{ | ||
public static Domain.Entities.Student MockValidStudent() => new( | ||
birthDate: new DateTime(2000, 1, 1), | ||
rg: 123456789, | ||
issuingAgency: "Agency", | ||
dispatchDate: new DateTime(2020, 1, 1), | ||
gender: EGender.M, | ||
race: ERace.White, | ||
homeAddress: "Street 1", | ||
city: "City", | ||
uf: "UF", | ||
cep: 12345678, | ||
phoneDDD: 11, | ||
phone: 12345678, | ||
cellPhoneDDD: 22, | ||
cellPhone: 987654321, | ||
campusId: Guid.NewGuid(), | ||
courseId: Guid.NewGuid(), | ||
startYear: "2022", | ||
studentAssistanceProgramId: Guid.NewGuid(), | ||
registrationCode: "GCOM1234567" | ||
); | ||
|
||
public static Domain.Entities.Student MockValidStudentWithId() => new( | ||
id: Guid.NewGuid(), | ||
birthDate: new DateTime(2000, 1, 1), | ||
rg: 123456789, | ||
issuingAgency: "Agency", | ||
dispatchDate: new DateTime(2020, 1, 1), | ||
gender: EGender.M, | ||
race: ERace.White, | ||
homeAddress: "Street 1", | ||
city: "City", | ||
uf: "UF", | ||
cep: 12345678, | ||
phoneDDD: 11, | ||
phone: 12345678, | ||
cellPhoneDDD: 22, | ||
cellPhone: 987654321, | ||
campusId: Guid.NewGuid(), | ||
courseId: Guid.NewGuid(), | ||
startYear: "2022", | ||
studentAssistanceProgramId: Guid.NewGuid(), | ||
registrationCode: "GCOM1234567" | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Domain.Entities; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class SubAreaMock | ||
{ | ||
public static SubArea MockValidSubArea() => new(Guid.NewGuid(), "ABC", "SubArea Name"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Domain.Entities.Enums; | ||
|
||
namespace Application.Tests.Mocks | ||
{ | ||
public static class UserMock | ||
{ | ||
public static Domain.Entities.User MockValidUser() => new(Guid.NewGuid(), "John Doe", "[email protected]", "strongpassword", "92114660087", ERole.ADMIN); | ||
|
||
} | ||
} |
Binary file not shown.
Oops, something went wrong.