public void NetworkCreateAndDeleteShallWork() { string id = null; try { var created = _docker.NetworkCreate("unit-test-nw"); if (created.Success) { id = created.Data[0]; } Assert.IsNotNull(id); } finally { if (null == id) { var networks = _docker.NetworkLs(_certificates); if (networks.Success) { id = networks.Data.Where(x => x.Name == "unit-test-nw").Select(x => x.Id).FirstOrDefault(); } } if (null != id) { _docker.NetworkRm(network: id); } } }