public CreateDraftApplicationTests() { this._module = IncidentReportModuleFactory.SetupAndBuild(); var _repository = InstanceResolver.Resolve <IDraftApplicationRepository>(); this._testFixture = new TestFixture(_repository); (_, this._suspiciousEmployee) = EmployeesTestFixture.PrepareApplicantAndRandomEmployeeInDb(); }
public PostApplicationUseCaseTests() { this._module = IncidentReportModuleFactory.SetupAndBuild(); var incidentApplicationRepository = InstanceResolver.Resolve <IIncidentApplicationRepository>(); var draftApplicationRepository = InstanceResolver.Resolve <IDraftApplicationRepository>(); this._testFixture = new TestFixture(incidentApplicationRepository, draftApplicationRepository); (this._applicant, this._suspiciousEmployee) = EmployeesTestFixture.PrepareApplicantAndRandomEmployeeInDb(); }
public async Task TwoNewSuspiciousEmployeeAdded_OneRemoved_DraftUpdatedSuccessfully() { //Arrange var initialSuspiciousEmployees = new List <EmployeeId> { this._suspiciousEmployee }; var newSuspiciousEmployees = EmployeesTestFixture.CreateRandomEmployeeInDb(2); var useCase = await this._testFixture.PrepareUseCaseWithTestData(this._applicant, newSuspiciousEmployees, initialSuspiciousEmployees); //Act var useCaseOutput = (UpdateDraftApplicationUseCaseOutputPort)await this._module.ExecuteUseCase(useCase); //Assert var draftApplicationFromContext = await this._testFixture.GetDraftFromContext(useCase.DraftApplicationId); Assert.AreEqual(OutputPortInvokedMethod.Standard, useCaseOutput.InvokedOutputMethod); Assert.AreEqual(2, draftApplicationFromContext.SuspiciousEmployees.Count); }
public void Setup() { this._testClient = TestClientFactory.GetHttpClient(); (this._applicant, this._suspiciousEmployee) = EmployeesTestFixture.PrepareApplicantAndRandomEmployeeInDb(); }