Beispiel #1
0
        public void Get_All()
        {
            List <Advertisement> _listAds = _advertisementGenerator.GenerateAds(10);
            var mockAd = GetMockAd();

            mockAd.Setup(x => x.Get()).Returns(_listAds);

            var adController = new AdvertisementController(mockAd.Object);

            List <Advertisement> _newAds = adController.Get().ToList();

            Assert.Equal(_listAds.Count, _newAds.Count);

            Assert.Equal(_listAds[3], _newAds[3]);
            Assert.Equal(_listAds[5], _newAds[5]);
        }