Ejemplo n.º 1
0
        public void Test_Lock__new_resource__Expected_lock()
        {
            // FIXTURES
            Setup();
            var resource = "da39a3ee5e6b4b0d3255bfef95601890afd80709";

            // EXERCISE
            var result = _service.Lock(resource);

            // ASSERTS
            Assert.True(result);
        }
Ejemplo n.º 2
0
        public ActionResult Post([FromBody] string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(BadRequest("value is Empty"));
            }

            if (_service.Lock(value))
            {
                return(Ok(value));
            }

            return(BadRequest($"Value: [{value}] already locked"));
        }