예제 #1
0
        public void RatingTest()
        {
            var optionsBuilder = new DbContextOptionsBuilder <IGContext>();

            optionsBuilder.UseInMemoryDatabase("IELTS_GiaSu");
            var dbContext = new IGContext(optionsBuilder.Options);
            var dateTime  = DateTime.UtcNow;
            var ratingObj = new IG_Rating_Login_Service
            {
                feedback    = "Hệ thống tốt",
                loginToken  = MD5Generator.CreateMD5(dateTime.ToString()),
                timestamp   = dateTime,
                serviceCode = "IG_VeSinh",
                ratingPoint = 5
            };

            dbContext.IG_Rating_Login_Service.Add(ratingObj);
            var result = dbContext.SaveChanges();

            if (result > 0)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
예제 #2
0
 public void Save()
 {
     dbContext.SaveChanges();
 }