private static VirtualMachine InitVirtualMachineOperation(MockRequestChannel mockChannel, out VirtualMachineOperations vmOperations)
        {
            //Cloud for return value of first request (client gets cloud to get stampId)
            var testCloud = new Cloud {ID = Guid.NewGuid(), StampId = Guid.NewGuid()};
            mockChannel.AddReturnObject(testCloud);

            //VM for return value of second request (client updates VM with operation)
            var testVM = new VirtualMachine {ID = Guid.NewGuid(), StampId = testCloud.StampId};
            mockChannel.AddReturnObject(testVM, new WebHeaderCollection {"x-ms-request-id:" + Guid.NewGuid()});

            var factory = new WebClientFactory(new Subscription(), mockChannel);
            vmOperations = new VirtualMachineOperations(factory);

            return testVM;
        }
 public void ShouldCreateWAPackIaaSClient()
 {
     var factory = new WebClientFactory(new Subscription(), null);
     Assert.IsInstanceOfType(factory.CreateClient("a"), typeof(WAPackIaaSClient));
 }
 public void ShouldCreateWAPackIaaSClient()
 {
     var factory = new WebClientFactory(new Subscription(), null);
     Assert.NotNull(factory.CreateClient("a"));
 }
 public void ShouldThrowWithNullSubscription()
 {
     var factory = new WebClientFactory(null, null);
     factory.CreateClient(string.Empty);
 }
 public void ShouldThrowWithNullSubscription()
 {
     var factory = new WebClientFactory(null, null);
     Assert.Throws<ArgumentNullException>(() => factory.CreateClient(string.Empty));
 }