Exemplo n.º 1
0
        public void Init()
        {
            _poolService = new PoolService();
            _pool        = Substitute.For <IObjectPool <PoolableEntity> >();

            _poolService.AddPool(_pool);
        }
 public IActionResult Post([FromBody] Pool pool)
 {
     try
     {
         return(new JsonResult(_poolService.AddPool(pool)));
     }
     catch
     {
         return(BadRequest());
     }
 }
Exemplo n.º 3
0
 public void AddPool_SameType_ThrowsException()
 {
     Assert.Throws <ArgumentException>(() => _poolService.AddPool(_pool));
 }