Пример #1
0
        public async Task PowerRestartVirtualMachineAsync_ExpectedResult()
        {
            IUKFastECloudClient client = Substitute.For <IUKFastECloudClient>();

            var ops = new VirtualMachineOperations <VirtualMachine>(client);
            await ops.PowerRestartVirtualMachineAsync(123);

            await client.Received().PutAsync("/ecloud/v1/vms/123/power-restart");
        }
Пример #2
0
        public async Task PowerRestartVirtualMachineAsync_InvalidVirtualMachineID_ThrowsUKFastClientValidationException()
        {
            var ops = new VirtualMachineOperations <VirtualMachine>(null);

            await Assert.ThrowsExceptionAsync <UKFastClientValidationException>(() => ops.PowerRestartVirtualMachineAsync(0));
        }