public void forecastInvoiceThrowsTargetInvocationException583() { ForecastingManager forecastingManager; Invoice invoice; forecastingManager = new ForecastingManager(); forecastingManager.mediator = (EMMediator)null; Invoice s0 = new Invoice(); s0.Id = 0; s0.PresentRead = 0; s0.PreviousRead = 0; s0.KWh = 0; s0.StandingCharge = 0; s0.ConsumptionCharge = 0; s0.OtherCharge = 0; s0.Checked = false; s0.ConsumptionIsValid = false; s0.CostIsValid = false; s0.BillDate = default(DateTime); s0.StartDate = new DateTime(4611686018427387903L & 607282404982784L, (DateTimeKind)(607282404982784uL >> 62)); s0.EndDate = default(DateTime); s0.CostVariance = 0; s0.KWhVariance = 0; s0.CostCanBeValidated = default(bool?); s0.ConsumptionCanBeValidated = default(bool?); s0.Meter = (Meter)null; invoice = this.forecastInvoice(forecastingManager, s0); }
public void forecastInvoiceThrowsTargetInvocationException383() { ForecastingManager forecastingManager; Invoice invoice; forecastingManager = new ForecastingManager(); forecastingManager.mediator = (EMMediator)null; invoice = this.forecastInvoice(forecastingManager, (Invoice)null); }
internal Invoice forecastInvoice([PexAssumeUnderTest] ForecastingManager target, Invoice lastInvoice) { object[] args = new object[1]; args[0] = (object)lastInvoice; Type[] parameterTypes = new Type[1]; parameterTypes[0] = typeof(Invoice); Invoice result0 = ((MethodBase)(typeof(ForecastingManager).GetMethod("forecastInvoice", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic, (Binder)null, CallingConventions.HasThis, parameterTypes, (ParameterModifier[])null))) .Invoke((object)target, args) as Invoice; Invoice result = result0; return(result); // TODO: add assertions to method ForecastingManagerTest.forecastInvoice(ForecastingManager, Invoice) }
public void forecastInvoiceThrowsTargetInvocationException345() { ForecastingManager forecastingManager; Invoice invoice; forecastingManager = new ForecastingManager(); forecastingManager.mediator = (EMMediator)null; Invoice s0 = new Invoice(); s0.Id = 0; s0.PresentRead = 0; s0.PreviousRead = 0; s0.KWh = 0; s0.StandingCharge = 0; s0.ConsumptionCharge = 0; s0.OtherCharge = 0; s0.Checked = false; s0.ConsumptionIsValid = false; s0.CostIsValid = false; s0.BillDate = default(DateTime); s0.StartDate = new DateTime(4611686018427387903L & 563247985000448L, (DateTimeKind)(563247985000448uL >> 62)); s0.EndDate = new DateTime(4611686018427387903L & 563247985000448L, (DateTimeKind)(563247985000448uL >> 62)); s0.CostVariance = 0; s0.KWhVariance = 0; s0.CostCanBeValidated = default(bool?); s0.ConsumptionCanBeValidated = default(bool?); Meter s1 = new Meter(); s1.Id = 0; s1.SerialNo = (string)null; s1.KWhtoCO2ConversionFactor = 0; s1.NumbDigits = 0; s1.Fuel = (string)null; s1.StartDate = default(DateTime); s1.Invoices = (ICollection <Invoice>)null; s1.Notes = (ICollection <Annotation>)null; s1.Tariffs = (ICollection <Tariff>)null; s1.Register = (ICollection <MeterReading>)null; s0.Meter = s1; invoice = this.forecastInvoice(forecastingManager, s0); }
public void forecastInvoiceThrowsTargetInvocationException345() { ForecastingManager forecastingManager; Invoice invoice; forecastingManager = new ForecastingManager(); forecastingManager.mediator = (EMMediator)null; Invoice s0 = new Invoice(); s0.Id = 0; s0.PresentRead = 0; s0.PreviousRead = 0; s0.KWh = 0; s0.StandingCharge = 0; s0.ConsumptionCharge = 0; s0.OtherCharge = 0; s0.Checked = false; s0.ConsumptionIsValid = false; s0.CostIsValid = false; s0.BillDate = default(DateTime); s0.StartDate = new DateTime(4611686018427387903L & 563247985000448L, (DateTimeKind)(563247985000448uL >> 62)); s0.EndDate = new DateTime(4611686018427387903L & 563247985000448L, (DateTimeKind)(563247985000448uL >> 62)); s0.CostVariance = 0; s0.KWhVariance = 0; s0.CostCanBeValidated = default(bool?); s0.ConsumptionCanBeValidated = default(bool?); Meter s1 = new Meter(); s1.Id = 0; s1.SerialNo = (string)null; s1.KWhtoCO2ConversionFactor = 0; s1.NumbDigits = 0; s1.Fuel = (string)null; s1.StartDate = default(DateTime); s1.Invoices = (ICollection<Invoice>)null; s1.Notes = (ICollection<Annotation>)null; s1.Tariffs = (ICollection<Tariff>)null; s1.Register = (ICollection<MeterReading>)null; s0.Meter = s1; invoice = this.forecastInvoice(forecastingManager, s0); }
//FORECASTING MANAGER /// <summary> /// Creates an invoice object (not saved to the database) with forecasted cost and consumption figures. Returns null if /// forecast not possible. /// </summary> /// <param name="meterId">id of meter for which to forecast invoice</param> /// <returns>JSON representation of Invoice (or null), wrapped in EMResponse</returns> public string forecastNextInvoice(int meterId) { EMResponse response = new EMResponse(); try { forecastingMgr = new ForecastingManager(); response.data = EMConverter.fromObjectToJSON(forecastingMgr.forecastNextInvoice(meterId)); response.status = ok; } catch (Exception e) { response.status = error; response.data = e.Message; } return EMConverter.fromObjectToJSON(response); }