Пример #1
0
        public void GetById_MustReturnUserWithoutData()
        {
            string key = "id";
            string id  = "a0ece5db-cd14-4f21-812f-966633e7be86ss";

            _mockyConnectorService.Setup(x => x.GetByKey(urlMocky, JsonModels.clients, key, id)).Returns(MockyConnectorStubs.GetClient(key, id));

            var result = _service.GetById(id);

            Assert.IsNull(result);
        }
Пример #2
0
        public void GetByUserName_MustReturnUserWithoutData()
        {
            string key  = "name";
            string name = "Mauro";

            _mockyConnectorService.Setup(x => x.GetByKey(urlMocky, JsonModels.clients, key, name)).Returns(MockyConnectorStubs.GetClient(key, name));

            var result = _service.GetByUserName(name);

            Assert.IsNull(result);
        }
Пример #3
0
        public void GetById_MustReturnUserWithData()
        {
            string key = "id";
            string id  = "a0ece5db-cd14-4f21-812f-966633e7be86";

            _mockyConnectorService.Setup(x => x.GetByKey(urlMocky, JsonModels.clients, key, id)).Returns(MockyConnectorStubs.GetClient(key, id));

            var result = _service.GetById(id);

            Assert.AreEqual("admin", result.Role);
            Assert.AreEqual(id, result.Id);
        }
Пример #4
0
        public void GetByUserName_MustReturnUserWithData()
        {
            string key  = "name";
            string name = "Britney";

            _mockyConnectorService.Setup(x => x.GetByKey(urlMocky, JsonModels.clients, key, name)).Returns(MockyConnectorStubs.GetClient(key, name));

            var result = _service.GetByUserName(name);

            Assert.AreEqual("admin", result.Role);
            Assert.AreEqual(name, result.UserName);
        }