public void TestAddCycling() { using (new TransactionScope()) { TrainingContextTest db = new TrainingContextTest(); var originalCount = db.CyclingSessions.ToList().Count(); CyclingSession x = new CyclingSession(new DateTime(2020, 4, 19, 16, 45, 00), null, new TimeSpan(1, 0, 00), null, 219, TrainingType.Interval, "5x5 min 270", BikeType.IndoorBike); db.CyclingSessions.Add(x); db.SaveChanges(); Assert.AreEqual(originalCount + 1, db.CyclingSessions.ToList().Count()); } }
public void TestAddTraining() { using (new TransactionScope()) { TrainingContextTest db = new TrainingContextTest(); var originalCount = db.RunningSessions.ToList().Count(); RunningSession x = new RunningSession(new DateTime(2000, 2, 17, 12, 30, 00), 5000, new TimeSpan(0, 27, 17), null, TrainingType.Endurance, null); db.RunningSessions.Add(x); db.SaveChanges(); Assert.AreEqual(originalCount + 1, db.RunningSessions.ToList().Count()); } }