public void CommandOperator_DefaultValues_SetsNothing()
        {
            var expected = new NewAzureVmCommand();

            Command actual = expected;

            Assert.That(actual.Parameters, Is.Empty);
        }
        public void CommandOperator_LocationIsEmpty_SetsNothing()
        {
            var expected = new NewAzureVmCommand
            {
                Location = String.Empty
            };

            Command command = expected;
            var actual = command.Parameters.FirstOrDefault(x => x.Name == NewAzureVmCommand.LocationParameter);

            Assert.That(actual, Is.Null);
        }
        public void CommandOperator_LocationIsSomething_SetsLocation()
        {
            var expected = new NewAzureVmCommand
            {
                Location = "SomeLocation"
            };

            Command command = expected;
            var actual = command.Parameters.FirstOrDefault(x => x.Name == NewAzureVmCommand.LocationParameter);

            Assert.That(actual, Is.Not.Null);
            Assert.That(actual.Value, Is.EqualTo(expected.Location));
        }
        public void CommandOperator_DeploymentNameIsSomething_SetsDeploymentName()
        {
            var expected = new NewAzureVmCommand
            {
                DeploymentName = "SomeDeployment"
            };

            Command command = expected;
            var actual = command.Parameters.FirstOrDefault(x => x.Name == NewAzureVmCommand.DeploymentNameParameter);

            Assert.That(actual, Is.Not.Null);
            Assert.That(actual.Value, Is.EqualTo(expected.DeploymentName));
        }
        private static void ProvisionVirtualMachine(IPowershellExecutor executor, VirtualMachine virtualMachine, string imageName, string serviceName)
        {
            var newAzureVmConfigCommand = new NewAzureVmConfigCommand
            {
                Name = virtualMachine.Name,
                ImageName = imageName,
                InstanceSize = virtualMachine.Size
            };

            var addAzureProvisioningConfigCommand = new AddAzureProvisioningConfigCommand
            {
                Windows = true,
                AdminPassword = virtualMachine.AdminPassword,
                AdminUsername = virtualMachine.AdminUserName,
                TimeZone = virtualMachine.TimeZone
            };

            var newAzureVmCommand = new NewAzureVmCommand
            {
                //Location = virtualMachine.Location,
                ServiceName = serviceName,
                DeploymentName = serviceName,
                WaitForBoot = false
            };

            var results = executor.Execute(newAzureVmConfigCommand, addAzureProvisioningConfigCommand, newAzureVmCommand);
        }
        public void CommandOperator_WaitForBootIsTrue_SetsWaitForBoot()
        {
            var expected = new NewAzureVmCommand
            {
                WaitForBoot = true
            };

            Command command = expected;
            var actual = command.Parameters.FirstOrDefault(x => x.Name == NewAzureVmCommand.WaitForBootParameter);

            Assert.That(actual, Is.Not.Null);
        }