File tree Expand file tree Collapse file tree
integration/Networking/v2
unit/Networking/v2/Layer3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ public void DeletePorts(IEnumerable<Port> ports)
201201
202202 public void DeleteRouters ( IEnumerable < Router > routers )
203203 {
204- Task [ ] deletes = routers . Select ( x => _networkingService . DeleteRouterAsync ( x . Id ) ) . ToArray ( ) ;
204+ Task [ ] deletes = routers . Select ( router => router . DeleteAsync ( ) ) . ToArray ( ) ;
205205 Task . WaitAll ( deletes ) ;
206206 }
207207 #endregion
@@ -210,7 +210,7 @@ public void DeleteRouters(IEnumerable<Router> routers)
210210
211211 public void DeleteFloatingIPs ( IEnumerable < FloatingIP > floatingIPs )
212212 {
213- Task [ ] deletes = floatingIPs . Select ( x => _networkingService . DeleteFloatingIPAsync ( x . Id ) ) . ToArray ( ) ;
213+ Task [ ] deletes = floatingIPs . Select ( ip => ip . DeleteAsync ( ) ) . ToArray ( ) ;
214214 Task . WaitAll ( deletes ) ;
215215 }
216216 #endregion
Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
23using System . Linq ;
34using System . Net ;
45using System . Net . Http ;
6+ using OpenStack . Compute . v2_1 ;
7+ using OpenStack . Compute . v2_1 . Serialization ;
58using OpenStack . Serialization ;
69using OpenStack . Networking . v2 . Layer3 . Synchronous ;
710using OpenStack . Networking . v2 . Serialization ;
11+ using OpenStack . Synchronous ;
812using OpenStack . Testing ;
913using Xunit ;
1014
@@ -85,13 +89,19 @@ public void DeleteRouter(HttpStatusCode responseCode)
8589 {
8690 using ( var httpTest = new HttpTest ( ) )
8791 {
92+ Identifier portId = Guid . NewGuid ( ) ;
8893 Identifier routerId = Guid . NewGuid ( ) ;
8994 httpTest . RespondWithJson ( new Router { Id = routerId } ) ;
95+ httpTest . RespondWithJson ( new PortCollection
96+ {
97+ new Port { Id = portId }
98+ } ) ;
9099 httpTest . RespondWith ( ( int ) responseCode , "All gone!" ) ;
91100
92101 var router = _networking . GetRouter ( routerId ) ;
93102 router . Delete ( ) ;
94103
104+ httpTest . ShouldHaveCalled ( $ "*/routers/{ routerId } /remove_router_interface") ;
95105 httpTest . ShouldHaveCalled ( $ "*/routers/{ routerId } ") ;
96106 }
97107 }
You can’t perform that action at this time.
0 commit comments