示例#1
0
        public void キャッシュがない場合はWebから取得()
        {
            var sut = new AccessPointRepository(() => new List <AccessPoint> {
                new AccessPoint(), new AccessPoint(), new AccessPoint()
            });

            WebCache.Remove("AccessPoints");

            var spots = sut.All();

            Assert.AreEqual(3, spots.Count());
        }
示例#2
0
        public void キャッシュがある場合はキャッシュの内容を返す()
        {
            var sut = new AccessPointRepository(() => new List <AccessPoint> {
                new AccessPoint(), new AccessPoint(), new AccessPoint()
            });

            WebCache.Set("AccessPoints", new List <AccessPoint> {
                new AccessPoint()
            });

            var spots = sut.All();

            Assert.AreEqual(1, spots.Count());
        }
        // GET api/<controller>
        public IEnumerable <AccessPoint> Get()
        {
            var repos = new AccessPointRepository();

            return(repos.All());
        }