Esempio n. 1
0
 public override void ClassInitialize()
 {
     using (var db = new VoatDataContext())
     {
         //1
         db.Filter.Add(new Filter()
         {
             Pattern      = ".",
             IsActive     = false,
             Name         = "Match Anything",
             CreationDate = DateTime.UtcNow.AddDays(-10)
         });
         //2
         db.Filter.Add(new Filter()
         {
             Pattern      = @"evildomain\.evil",
             IsActive     = true,
             Name         = "Evil Domain is Banned",
             CreationDate = DateTime.UtcNow.AddDays(-10)
         });
         //3
         db.Filter.Add(new Filter()
         {
             Pattern      = @"google\.com/url",
             IsActive     = true,
             Name         = "Google redirect ban",
             CreationDate = DateTime.UtcNow.AddDays(-10)
         });
         db.SaveChanges();
     }
     //Remove Filters that may be in cache
     CacheHandler.Instance.Remove(CachingKey.Filters());
 }