public RtpOperationController(IRtpRepository rtpRepo, IRtpProjectRepository projectRepo, TripsRepository trepo) { RtpRepository = rtpRepo; RtpProjectRepository = projectRepo; TripsRepository = trepo; }
public void GetRtpActivePlanCycleIdTest() { TripsRepository target = new TripsRepository(); int actual; actual = target.GetRtpActivePlanCycleId(78); Assert.IsTrue(actual > 0); }
public void GetTipStatusTest() { TripsRepository target = new TripsRepository(); int rtpYearId = 80; TipStatusModel actual; actual = target.GetTipStatus(rtpYearId); Assert.IsNotNull(actual); }
public void TryCatchErrorTest() { TripsRepository target = new TripsRepository(); bool thrown = false; try { target.TryCatchError(); } catch (Exception) { thrown = true; } Assert.IsTrue(thrown, "TryCatchError did not throw an error!"); }
public void CrudRtpPlanCycleTest() { TripsRepository target = new TripsRepository(); var cycle = new DRCOG.Domain.ViewModels.RTP.PlanCycle() { Name = "Testicle", Description = "A Test Cycle" }; string rtpYear = "2035-S"; int yid = target.GetRtpPlanYearId(rtpYear); int cid = target.CreateRtpPlanCycle(cycle, yid); Assert.IsTrue(cid > 0, "Create RTP Plan Cycle makes an ID > 0"); var editCycle = target.GetRtpPlanCycle(cid); Assert.AreEqual(editCycle.Status, "New", "Create RTP Plan Cycle sets status to New"); Assert.IsNotNull(editCycle, "Get RTP Plan Cycle retrieves a PlanCycle"); editCycle.Name = "TestEdit"; editCycle.Description = "Edited Test Cycle"; target.UpdateRtpPlanCycle(editCycle); var actual = target.GetRtpPlanCycle(editCycle.Id); Assert.AreEqual(editCycle.Name, actual.Name, "UpdateRtpPlanCycle updates Name"); Assert.AreEqual(editCycle.Description, actual.Description, "UpdateRtpPlanCycle updates Description"); target.DeleteRtpPlanCycle(cid); }
public void RtpGetLrsTest() { TripsRepository target = new TripsRepository(); // TODO: Initialize to an appropriate value int id = 21129; // TODO: Initialize to an appropriate value LRS actual; actual = target.RtpGetLrs(id); Assert.IsNotNull(actual); }
public void RtpGetLrsForSegmentTest() { TripsRepository target = new TripsRepository(); // TODO: Initialize to an appropriate value int segmentId = 76413; // TODO: Initialize to an appropriate value IEnumerable<LRS> actual; actual = target.RtpGetLrsForSegment(segmentId); Assert.IsTrue(actual.Count() > 0); }
public void RtpDeleteLrsTest() { TripsRepository target = new TripsRepository(); // TODO: Initialize to an appropriate value int id = 21128; // TODO: Initialize to an appropriate value target.RtpDeleteLrs(id); }
public void RtpCreatePlanTest() { TripsRepository target = new TripsRepository(); TripsRepository.RtpCreatePlanRequest request = new TripsRepository.RtpCreatePlanRequest() { PlanName = "2200", CycleName = "2200-1", CycleDescription = "test cycle for test RTP" }; int actual; actual = target.RtpCreatePlan(request); Assert.IsTrue(actual > 0); }
public void RtpCreateLrsTest() { TripsRepository target = new TripsRepository(); // TODO: Initialize to an appropriate value LRS lrs = new LRS() { BEGINMEASU = 1, Comments = "your comment here", ENDMEASURE = .8, Improvetype = "Point", Network = "my friends", Routename = "Haggerty Blvd", SegmentId = 76413 }; int actual; actual = target.RtpCreateLrs(lrs); Assert.AreNotSame(0, actual); }