public void SetAzureAffinityGroupTest()
        {
            const string affinityGroupName = "myAffinity";

            // Setup
            bool updated = false;
            SimpleServiceManagement channel = new SimpleServiceManagement();
            channel.UpdateAffinityGroupThunk = ar =>
            {
                Assert.AreEqual(affinityGroupName, ar.Values["affinityGroupName"]);
                updated = true;
            };

            // Test
            SetAzureAffinityGroup removeAzureAffinityGroupCommand = new SetAzureAffinityGroup(channel)
            {
                ShareChannel = true,
                CommandRuntime = new MockCommandRuntime(),
                Name = affinityGroupName,
                Label = affinityGroupName
            };

            removeAzureAffinityGroupCommand.ExecuteCommand();
            Assert.IsTrue(updated);
        }
Example #2
0
        //[TestMethod]
        public void SetAzureAffinityGroupTest()
        {
            const string affinityGroupName = "myAffinity";

            // Setup
            bool updated = false;
            SimpleServiceManagement channel = new SimpleServiceManagement();

            channel.UpdateAffinityGroupThunk = ar =>
            {
                Assert.AreEqual(affinityGroupName, ar.Values["affinityGroupName"]);
                updated = true;
            };

            // Test
            SetAzureAffinityGroup removeAzureAffinityGroupCommand = new SetAzureAffinityGroup()
            {
                Channel        = channel,
                ShareChannel   = true,
                CommandRuntime = new MockCommandRuntime(),
                Name           = affinityGroupName,
                Label          = affinityGroupName
            };

            removeAzureAffinityGroupCommand.ExecuteCommand();
            Assert.IsTrue(updated);
        }