コード例 #1
0
        public void GetLayers_ShouldGetThem()
        {
            var layers = new List <MapLayerData> {
                new MapLayerData()
            };
            var osmUser = "******";

            _controller.SetupIdentity(null, osmUser);
            _repository.GetUserLayers(osmUser).Returns(layers);

            var result = _controller.GetUserLayers().Result as OkObjectResult;

            Assert.IsNotNull(result);
            var returnedUserLayers = result.Value as List <MapLayerData>;

            Assert.IsNotNull(returnedUserLayers);
            Assert.AreEqual(layers.Count, returnedUserLayers.Count);
        }
コード例 #2
0
        public void GetLayers_ShouldGetThem()
        {
            var userLayers = new UserLayers {
                Layers = new List <UserLayerData> {
                    new UserLayerData()
                }
            };
            var osmUser = "******";

            _controller.SetupIdentity(osmUser);
            _israelHikingRepository.GetUserLayers(osmUser).Returns(userLayers);

            var result = _controller.GetUserLayers().Result as OkObjectResult;

            Assert.IsNotNull(result);
            var returnedUserLayers = result.Value as UserLayers;

            Assert.IsNotNull(returnedUserLayers);
            Assert.AreEqual(returnedUserLayers.Layers.Count, userLayers.Layers.Count);
        }