Пример #1
0
        public void Find()
        {
            IScreenshot screenshot = new Screenshot()
            {
                Url = Faker.RoboHash.Image(),
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now
            };

            Assert.AreEqual(1, repository.Add(screenshot));

            IScreenshot screenshot1 = repository.Find(screenshot.Url);

            Assert.AreEqual(screenshot1.Url, screenshot.Url);
            Assert.AreEqual(screenshot1.CreatedAt.ToString("MM/dd/yyyy HH:mm"), screenshot.CreatedAt.ToString("MM/dd/yyyy HH:mm"));
            Assert.AreEqual(screenshot1.UpdatedAt.ToString("MM/dd/yyyy HH:mm"), screenshot.UpdatedAt.ToString("MM/dd/yyyy HH:mm"));
        }
Пример #2
0
        public void GetAll()
        {
            IScreenshot screenshot1 = new Screenshot()
            {
                Url = Faker.RoboHash.Image(),
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now
            };

            IScreenshot screenshot2 = new Screenshot()
            {
                Url = Faker.RoboHash.Image(),
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now
            };

            Assert.AreEqual(1, repository.Add(screenshot1));
            Assert.AreEqual(1, repository.Add(screenshot2));

            Assert.AreEqual(true, (repository.GetAll().Count > 0));

        }
Пример #3
0
        public void Update()
        {
            IScreenshot screenshot = new Screenshot()
            {
                Url = Faker.RoboHash.Image(),
                CreatedAt = DateTime.Now,
                UpdatedAt = DateTime.Now
            };

            Assert.AreEqual(1, repository.Add(screenshot));

            screenshot.UpdatedAt = DateTime.Now;

            Assert.AreEqual(1, repository.Update(screenshot));
        }