Exemplo n.º 1
0
 public IHttpActionResult Lock(string user, string file)
 {
     if (_lockingService.DoesLockExist(file))
     {
         return(BadRequest("The file is already locked"));
     }
     _lockingService.CreateLock(file, new List <string>()
     {
         string.Format("{0}|{1}", user, DateTime.Now.ToString())
     });
     return(Ok(string.Format("Locked: {0}", file)));
 }
Exemplo n.º 2
0
 public void ThenTheLockExistsAfterwards()
 {
     Assert.True(_fakeLockingService.DoesLockExist(fakeFile));
 }