public void AddIllegalTest() { DBStore dB = new DBStore(this.dBConnect); dB.Create(new Store() { Name = null }); }
public IActionResult Post([FromBody] StoreDto storedto) { try { provider.Create(storedto.toDao()); return(Ok("Store created succsessfully.")); } catch (Exception e) { return(BadRequest($"ERROR: {e.Message}")); } }
public void AddRemoveEntityTest() { DBStore dB = new DBStore(this.dBConnect); var sp = new Store() { Name = "Netto", DistrictID = 1 }; var stores = dB.GetAll(); var oldCount = stores.Count(); dB.Create(sp); Assert.IsTrue(dB.GetAll().Count() > oldCount, "Store not created"); stores = dB.GetAll(); sp = stores.Last(); dB.Delete(sp.ID); Assert.IsTrue(dB.GetAll().Count() == oldCount, "Store not removed"); }