public void UpdateDeliverableTest() { try { var updateDeliverable = new DeliverablesDTO(); updateDeliverable.ClientId = 41; updateDeliverable.DeliverableId = 361; updateDeliverable.SubscriptionId = 4960; updateDeliverable.FrequencyId = 2; updateDeliverable.FrequencyTypeId = 2; updateDeliverable.PeriodId = 7; updateDeliverable.ReportWriterId = 38; updateDeliverable.RestrictionId = 1; updateDeliverable.probe = false; updateDeliverable.Census = false; updateDeliverable.PackException = false; updateDeliverable.OneKey = false; updateDeliverable.ReportNo = 2; updateDeliverable.StartDate = DateTime.Now; updateDeliverable.LastModified = DateTime.Now; var startDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); var endDate = new DateTime(DateTime.Now.Year, 12, 1); updateDeliverable.StartDate = startDate; updateDeliverable.EndDate = endDate; updateDeliverable.marketDefs = deliverableController.GetClientMarketDefDTO(updateDeliverable.DeliverableId); updateDeliverable.territories = deliverableController.GetDeliverablesTerritories(updateDeliverable.DeliverableId); updateDeliverable.clients = deliverableController.GetDeliverablesClientList(updateDeliverable.DeliverableId); updateDeliverable.clients = deliverableController.GetDeliverablesClientList(updateDeliverable.DeliverableId); //Subchannels updateDeliverable.SubChannelsDTO = deliverableController.GetSubchannels(updateDeliverable.DeliverableId); updateDeliverable.ReportNo = deliverableController.getIRPReportNo(updateDeliverable.DeliverableId); deliverableController.UpdateDeliverables(updateDeliverable); EverestPortalContext dbContext = new EverestPortalContext(); Deliverables ObjDelivery = new Deliverables(); using (var transaction = dbContext.Database.BeginTransaction()) { ObjDelivery = dbContext.deliverables.Where(p => p.DeliverableId == updateDeliverable.DeliverableId).SingleOrDefault(); } Assert.IsNotNull(ObjDelivery); } catch (Exception exc) { Assert.Fail(exc.Message); } }
public string GetDeliverablesReport(int Id, int startVersion, int endVersion, string reportName) { IAuditReport report = new DeliverableReport(); DeliverablesDTO result = report.GenerateReport(Id, startVersion, endVersion, reportName); var json = JsonConvert.SerializeObject(result, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }); return(json); }
public void GetDeliverableByDeiverableIdTest() { try { var clientId = 41; var deliverableId = 361; var resultString = deliverableController.GetDeliverableByID(deliverableId, clientId); DeliverablesDTO DeliveryObj = new DeliverablesDTO(); DeliveryObj = JsonConvert.DeserializeObject <DeliverablesDTO>(resultString); Assert.IsNotNull(DeliveryObj); } catch (Exception exc) { Assert.Fail(exc.Message); } }