public void MountImageTest() { WimgApi.MountImage(MountPath, TestWimPath, 1); try { WimMountInfoCollection mountedImages = WimgApi.GetMountedImageInfo(); mountedImages.Count.ShouldBe(1); } finally { WimgApi.UnmountImage(MountPath, TestWimPath, 1, false); } }
public void GetMountedImageInfoTest() { ExecuteAgainstMountedImage((wimHandle, imageHandle) => { WimMountInfoCollection wimMountInfos = WimgApi.GetMountedImageInfo(); wimMountInfos.ShouldNotBeNull(); wimMountInfos.Count.ShouldBe(1); WimMountInfo wimMountInfo = wimMountInfos.FirstOrDefault(); wimMountInfo.ShouldNotBeNull(); // ReSharper disable once PossibleNullReferenceException wimMountInfo.ImageIndex.ShouldBe(1); wimMountInfo.MountPath.ShouldBe(MountPath, StringCompareShould.IgnoreCase); wimMountInfo.Path.ShouldBe(TestWimPath); wimMountInfo.ReadOnly.ShouldBeTrue(); wimMountInfo.State.ShouldBe(WimMountPointState.Mounted); }); }