Click here to Skip to main content
15,891,567 members
Articles / Containers / Virtual Machine

Automating VMWare Tasks in C# with the VIX API

Rate me:
Please Sign up or sign in to vote.
4.91/5 (32 votes)
13 Feb 2009MIT5 min read 389.8K   4K   101  
A VMWare C# tasks library.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Vestris.VMWareLib;

namespace Vestris.VMWareLibUnitTests
{
    [TestFixture]
    public class VMWareExceptionTests
    {
        [Test]
        [ExpectedException(ExceptionType = typeof(VMWareException), ExpectedMessage = "The operation was successful")]
        public void TestThrowOperationWasSuccessfulException()
        {
            throw new VMWareException(0);
        }

        [Test]
        [ExpectedException(ExceptionType = typeof(VMWareException), ExpectedMessage = "Unknown error")]
        public void TestThrowUnknownErrorException()
        {
            throw new VMWareException(1);
        }

        [Test]
        [ExpectedException(ExceptionType = typeof(VMWareException), ExpectedMessage = "This login type is not supported")]
        public void TestThrowLoginTypeNotSupportedException()
        {
            throw new VMWareException(3032);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
dB.
Team Leader Application Security Inc., www.appsecinc.com
United States United States
Daniel Doubrovkine has been in software engineering for twelve years and is currently development manager at Application Security Inc. in New York City. He has been involved in many software ventures, including Xo3 and Vestris Inc, was a development lead at Microsoft Corp. in Redmond, and director of Engineering at Visible Path Corp. in New York City. Daniel also builds and runs a foodie website, http://www.foodcandy.com.

Comments and Discussions