예제 #1
0
        public void ListFloatingIPs()
        {
            using (var httpTest = new HttpTest())
            {
                Identifier floatingIPId = Guid.NewGuid();
                httpTest.RespondWithJson(new FloatingIPCollection
                {
                    new FloatingIP {
                        Id = floatingIPId
                    }
                });

                var results = _networking.ListFloatingIPs(new FloatingIPListOptions {
                    Status = FloatingIPStatus.Active
                });

                httpTest.ShouldHaveCalled("*/floatingips?status=ACTIVE");
                Assert.Equal(1, results.Count());
                var result = results.First();
                Assert.Equal(floatingIPId, result.Id);
                Assert.IsType <NetworkingApiBuilder>(((IServiceResource)result).Owner);
            }
        }