Example #1
0
 internal VirtualMachine(
     IConfiguration config,
     IProcessRunner runner,
     IDiskPathGetter pathGetter,
     IDiskUuidGetter uuidGetter,
     string name)
 {
     _config       = config;
     ProcessRunner = runner;
     _pathGetter   = pathGetter;
     _uuidGetter   = uuidGetter;
     Name          = name;
 }
Example #2
0
 internal VirtualMachineFactory(
     IConfiguration config,
     IUnityContainer container,
     IProcessRunner runner,
     IDiskPathGetter pathGetter,
     IDiskUuidGetter uuidGetter)
 {
     _config     = config;
     _container  = container;
     _runner     = runner;
     _pathGetter = pathGetter;
     _uuidGetter = uuidGetter;
 }
Example #3
0
        public async Task Throw_ArgumentEx_When_File_DoesNot_Exist()
        {
            // Arrange
            var test = new TestContainer();

            const string FilePath = @"some\file\path.vhd";

            test.FileSystem.Setup(m => m.FileExists(It.IsAny <string>())).Returns(true);
            test.FileSystem.Setup(m => m.FileExists(FilePath)).Returns(false);

            IDiskUuidGetter getter = test.RegisterAll().Resolve <DiskUuidGetter>();

            // Act
            var ex = await TestAssistant.CatchExceptionAsync(getter.GetDiskUuidAsync(FilePath));

            // Assert
            Assert.IsNotNull(ex);
            Assert.IsTrue(ex is ArgumentException);
        }