public async Task FormResponseRepository_DeleteFormResponse_Success()
        {
            //arrange
            FormBuild       formBuild = new FormBuild("Teste", DateTime.Now);
            IntFieldBuilder intField  = new IntFieldBuilder("value_test", 5, 10, true);

            formBuild.AddField(intField);

            FormResponse     formResponse     = new FormResponse(formBuild);
            IntFieldResponse intFieldResponse = new IntFieldResponse(intField);

            intFieldResponse.SetValue(10);
            formResponse.AddField(intFieldResponse);

            await _repository.AddAsync(formResponse);

            await _unitOfWork.SaveChangesAsync();

            int formResponseId = formResponse.Id;

            //act
            await _repository.RemoveAsync(formResponseId);

            await _unitOfWork.SaveChangesAsync();

            FormResponse formResponseNotFound = await _dbContext.FormResponses.FindAsync(formResponseId);

            //assert
            Assert.Null(formResponseNotFound);
        }
Пример #2
0
 public async Task RemoveAsync(int id)
 {
     await _repository.RemoveAsync(id);
 }