Example #1
0
        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();
            }
        }
Example #2
0
    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();
        }
Example #4
0
 public UserRepositoryTests()
 {
     _context = TestContextFactory.Create();
 }
 public GroupRepositoryTests()
 {
     _context = TestContextFactory.Create();
 }
Example #6
0
 public MessageRecipientRepositoryTests()
 {
     _context = TestContextFactory.Create();
 }
Example #7
0
 public FriendshipChangeRepositoryTests()
 {
     _context = TestContextFactory.Create();
 }