using Nonemm.Digital; namespace Nonemm.Digital.Tests; /// Where the control is put in each kind of prefix. public class WinePrefixSetupTests { [Fact] public void AThirtyTwoBitPrefixTakesTheControlInSystem32() { (string folder, string regsvr32) = WinePrefixSetup.Places(isSixtyFourBit: false); Assert.Equal(@"C:\windows\system32", folder); Assert.Equal(@"C:\windows\system32\regsvr32.exe", regsvr32); } /// The 64-bit regsvr32 cannot load a 32-bit control, so a 64-bit prefix is /// registered with the one in syswow64. [Fact] public void ASixtyFourBitPrefixTakesItInSyswow64() { (string folder, string regsvr32) = WinePrefixSetup.Places(isSixtyFourBit: true); Assert.Equal(@"C:\windows\syswow64", folder); Assert.Equal(@"C:\windows\syswow64\regsvr32.exe", regsvr32); } [Fact] public async Task AControlThatIsNotThereIsSaidSo() { WinePrefixSetup setup = new("/nowhere"); await Assert.ThrowsAsync( () => setup.RegisterAsync("/nowhere/XMMT.ocx")); } }