Beispiel #1
0
        public void WavToMp3_ConvertAndSave_ReportsUnsupportedWav()
        {
            var messageBoxAdapter = new MockMessageBox(DialogResult.OK);

            MessageBoxUtils.Manager.SetMessageBoxAdapter(messageBoxAdapter);
            using (var tempDirPath = new TemporaryFolder(Path.GetRandomFileName()))
            {
                var file        = Path.ChangeExtension(Path.GetRandomFileName(), ".mp3");
                var destination = tempDirPath.Combine(tempDirPath.Path, file);
                Assert.DoesNotThrow(() => WavConverter.WavToMp3(_badWavFile, destination));
                Assert.IsFalse(File.Exists(destination), "WavConverter should not have created an mp3 file.");
                Assert.AreEqual(1, messageBoxAdapter.MessagesDisplayed.Count);
                Assert.That(messageBoxAdapter.MessagesDisplayed[0],
                            Is.StringStarting(string.Format(FwUtilsStrings.ConvertBytesToMp3_BadWavFile, file, string.Empty, string.Empty)));
            }
        }
Beispiel #2
0
 public int ShowMessageBox(uint dwCompRole, ref Guid rclsidComp, string pszTitle, string pszText, string pszHelpFile, uint dwHelpContextID, OLEMSGBUTTON msgbtn, OLEMSGDEFBUTTON msgdefbtn, OLEMSGICON msgicon, int fSysAlert, out int pnResult)
 {
     pnResult = (int)_instance.Invoke(
         () =>
     {
         MockDialog dialog = new MockMessageBox(_instance, pszTitle, pszText);
         lock (Dialogs)
         {
             Dialogs.Push(dialog);
         }
         dialog.Run();
         lock (Dialogs)
         {
             Dialogs.Pop();
         }
         return(dialog.DialogResult);
     }
         );
     return(VSConstants.S_OK);
 }