Ejemplo n.º 1
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);
        }