コード例 #1
0
 /// <summary>
 /// upload the screenshot
 /// </summary>
 /// <param name="screenShot"></param>
 public void SaveImage(Image image, string user, string captureTime)
 {
     ScreenShot screenShot = new ScreenShot();
     screenShot.image = image;
     screenShot.timeStamp = DateTime.Parse(captureTime);
     screenShot.user = user;
     dataLayer.insertScreenShot(screenShot);
 }
コード例 #2
0
        public void insertScreenShotValidInputTest()
        {
            ScreenShotActions_Accessor target = new ScreenShotActions_Accessor(true); // TODO: Initialize to an appropriate value
            ScreenShot screenShot = new ScreenShot();
            screenShot.timeStamp = DateTime.Now;
            screenShot.user = insertedUser;
            Bitmap bitmap = new Bitmap(800, 600);
            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                graphics.CopyFromScreen(0, 0, 0, 0, new Size(800, 600));
            }
            screenShot.image = bitmap;
            Guid newlyInsertedId = target.insertScreenShot(screenShot);
            Assert.IsNotNull(newlyInsertedId);

            ScreenShot returnedScreenShot = target.getScreenShotById(newlyInsertedId);
            Assert.IsNotNull(returnedScreenShot);
            Assert.AreEqual(returnedScreenShot.user, insertedUser);
            Assert.AreEqual(returnedScreenShot.timeStamp.DayOfYear, DateTime.Now.DayOfYear);

            insertedId = newlyInsertedId;
        }
コード例 #3
0
 public Guid insertScreenShot(ScreenShot screenShot)
 {
     return Guid.Empty;
 }