private void AddMovie(string name, string summary = null, string actors = null, double rating = 5, DateTime?airDate = null) { using (var db = _contextFactory.Create()) { var actorsDb = actors.Split(',').Select(a => db.Actors.Single(s => s.FullName == a)); db.Movies.Add(new Data.Entity.Movie() { Cast = actorsDb.ToList(), AirDate = airDate, Rating = rating, Summary = summary, Title = name }); db.SaveChanges(); } }
public AvailabilityRepositoryTests() { _context = TestContextFactory.Create(); // Insert Test Data for (int index = 1; index <= 3; index++) { _context.Availabilities.Add(new Availability { AvailabilityId = index, UserId = index, Status = AvailabilityStatus.Online, Modified = DateTime.Now, ModifiedManually = false, }); } _context.SaveChanges(); _context.ChangeTracker.Clear(); }
private static void EnsureDbExists() { var ctx = TestContextFactory.Create(); ctx.Database.EnsureNewDatabase(); }
public UserRepositoryTests() { _context = TestContextFactory.Create(); }
public GroupRepositoryTests() { _context = TestContextFactory.Create(); }
public MessageRecipientRepositoryTests() { _context = TestContextFactory.Create(); }
public FriendshipChangeRepositoryTests() { _context = TestContextFactory.Create(); }