Exemplo n.º 1
0
        public CreateDraftApplicationTests()
        {
            this._module = IncidentReportModuleFactory.SetupAndBuild();
            var _repository = InstanceResolver.Resolve <IDraftApplicationRepository>();

            this._testFixture             = new TestFixture(_repository);
            (_, this._suspiciousEmployee) = EmployeesTestFixture.PrepareApplicantAndRandomEmployeeInDb();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void Setup()
 {
     this._testClient = TestClientFactory.GetHttpClient();
     (this._applicant, this._suspiciousEmployee) = EmployeesTestFixture.PrepareApplicantAndRandomEmployeeInDb();
 }