Ejemplo n.º 1
0
        public void CreateKeyPair()
        {
            using (var httpTest = new HttpTest())
            {
                const string name = "keypair-name";
                httpTest.RespondWithJson(new KeyPairResponse {
                    Name = name, PrivateKey = Guid.NewGuid().ToString()
                });
                KeyPairResponse result = _computeService.CreateKeyPair(new KeyPairRequest(name));

                httpTest.ShouldHaveCalled("*/os-keypairs");
                Assert.NotNull(result);
                Assert.Equal(name, result.Name);
                Assert.NotNull(result.PrivateKey);
            }
        }