public void AddOrUpdateTest1() {
     var target = new TweetSummaryService();
     var actual = target.AddOrUpdate(new TweetSummary() { Id = Guid.NewGuid(), Date = new DateTime(2015, 1, 4), });
     Assert.AreEqual(actual, true);
     using (var dbContext = new DefaultConnectionContext()) {
         foreach (var item in dbContext.TweetSummaries) {
             Debug.WriteLine(item);
         }
     }
 }
 public void AddOrUpdateTest2() {
     var target = new TweetLogService();
     var actual = target.AddOrUpdate(new TweetLog() { Id = Guid.NewGuid(), StatusId = "3", });
     Assert.AreEqual(actual, true);
     using (var dbContext = new DefaultConnectionContext()) {
         foreach (var item in dbContext.TweetLogs) {
             Debug.WriteLine(item);
         }
     }
 }
 public static void ClassInitialize(TestContext testContext) {
     AppDomain.CurrentDomain.SetData("DataDirectory", testContext.TestDeploymentDir);
     using (var dbContext = new DefaultConnectionContext()) {
         dbContext.Database.Delete();
         dbContext.Database.Create();
         dbContext.TweetLogs.AddOrUpdate(new[] {
             new TweetLog() { Id = Guid.NewGuid(), StatusId = "1", TweetedAt = new DateTime(2015, 1, 1, 03, 0, 0), },
             new TweetLog() { Id = Guid.NewGuid(), StatusId = "2", TweetedAt = new DateTime(2015, 1, 1, 10, 0, 0), },
             new TweetLog() { Id = Guid.NewGuid(), StatusId = "3", TweetedAt = new DateTime(2015, 1, 2, 19, 0, 0), },
         });
         dbContext.SaveChanges();
     }
 }
Exemple #4
0
 /// <summary>
 /// <see cref="Karemem0.Preddy.Services.TweetLogService"/> クラスの新しいインスタンスを初期化します。
 /// </summary>
 public TweetLogService() {
     this.dbContext = new DefaultConnectionContext();
 }
Exemple #5
0
 /// <summary>
 /// <see cref="Karemem0.Preddy.Services.TweetService"/> クラスの新しいインスタンスを初期化します。
 /// </summary>
 public ChartService() {
     this.dbContext = new DefaultConnectionContext();
 }
 public static void ClassCleanup() {
     using (var dbContext = new DefaultConnectionContext()) {
         dbContext.Database.Delete();
     }
 }
 public void ShrinkTest1() {
     var target = new TweetLogService();
     target.Shrink();
     using (var dbContext = new DefaultConnectionContext()) {
         foreach (var item in dbContext.TweetLogs) {
             Debug.WriteLine(item);
         }
     }
 }