public void LoadFromJson_EmptyJson() { _target.prediction_json = String.Empty; _target.LoadFromJson(); Assert.AreEqual(0, _target.PredictionTrips.Count, "checking PredictionTrips.Count"); }
private void LoadJson(string json) { Trace.TraceInformation("loading json"); Prediction p = new Prediction { prediction_time = DateTime.UtcNow, prediction_json = json }; p.LoadFromJson(); Trace.TraceInformation("saving to database"); using (var db = this.TrackerDb) { db.Predictions.Add(p); db.SaveChanges(); } }