public FileServiceTests() { this.service = FileServiceTestData.CreateService(base.Context, base.Configuration); this.tbMapFileFundCount = base.Context.TbMapFilefund.Count(); this.tbFileCount = base.Context.TbFile.Count(); this.tbSAFundCount = base.Context.TbServiceAgreementFund.Count(); }
public async Task UploadAgreement_Fund_WithUnvalidId_ShouldThrowException(int fundId) { var agreement = FileServiceTestData.GenerateAgreement(fundId, "20160101"); Func <Task> task = async() => await this.service.UploadAgreement(agreement); await Assert.ThrowsAsync <CustomSqlException>(task); }
public async Task UploadDocument_Fund_WithUnvalidData_ShouldThrowException(int fundId, string date) { var startConnection = DateTime.Parse(date); var document = FileServiceTestData.GenerateDocument(fundId, startConnection); Func <Task> task = async() => await this.service.UploadDocument(document); await Assert.ThrowsAsync <CustomSqlException>(task); }
private UploadDocumentInputModel SetDocumentValues(string docType = "Prospectus") { var fundId = 16; var tbMapFile = base.Context.TbMapFilefund.ToList(); var startConnection = tbMapFile .Where(x => x.DocFundId == fundId) .Select(x => (DateTime)x.DocEndConnection) .FirstOrDefault(); return(FileServiceTestData.GenerateDocument(fundId, startConnection.AddDays(1), docType)); }
private UploadAgreementInputModel SetAgreementValues(string agrType = "Management Company Agreement") { var fundId = 16; var tbSaAgr = base.Context.TbServiceAgreementFund.ToList(); var activationDate = tbSaAgr .Where(x => x.SaFundId == fundId) .Select(x => x.SaActivationDate) .FirstOrDefault(); return(FileServiceTestData.GenerateAgreement(fundId, activationDate.ToString(), agrType)); }