public void GetById()
        {
            // Arrange
            CarAdvertController controller = new CarAdvertController();

            controller.DummyAdvertList = TestAdvertList.ToList();
            // Act
            CarAdvertViewModel result = controller.GetAdvertById(5);

            // Assert
            Assert.AreEqual(TestAdvertList.ElementAtOrDefault(4), result);
        }
        public void Put()
        {
            // Arrange
            CarAdvertController controller = new CarAdvertController();

            controller.DummyAdvertList = TestAdvertList.ToList();
            // Act
            CarAdvertViewModel putAdvert = new CarAdvertViewModel(5);

            controller.PutAdvert(5, putAdvert);
            IEnumerable <CarAdvertViewModel> result = controller.GetAll();

            // Assert
            Assert.AreEqual(6, result.Count());
            Assert.AreEqual(putAdvert.Title, result.ElementAt(4).Title);
        }
        public void Delete()
        {
            // Arrange
            CarAdvertController controller = new CarAdvertController();

            controller.DummyAdvertList = TestAdvertList.ToList();
            // Act
            CarAdvertViewModel oldAdvertOne = controller.GetAdvertById(1);
            CarAdvertViewModel oldAdvertTwo = controller.GetAdvertById(2);

            controller.DeleteAdvert(1);
            IEnumerable <CarAdvertViewModel> result = controller.GetAll();

            // Assert
            Assert.AreEqual(5, result.Count());
            Assert.AreNotEqual(oldAdvertOne, result.ElementAt(0));
            Assert.AreEqual(oldAdvertTwo, result.ElementAt(0));
        }