public void GeneralTest() { var fileType = new FileType("Bitmap Image (*.bmp)", ".bmp"); var result = new FileDialogResult(@"C:\image.bmp", fileType); Assert.IsTrue(result.IsValid); Assert.AreEqual(@"C:\image.bmp", result.FileName); Assert.AreEqual(fileType, result.SelectedFileType); Assert.AreEqual(@"C:\image.bmp", result.GetFullFileName()); }
public void GetFullFileNameTest() { var fileType = new FileType("Bitmap Image (*.bmp)", ".bmp"); var result = new FileDialogResult(@"C:\image.bmp", fileType); Assert.AreEqual(@"C:\image.bmp", result.GetFullFileName()); result = new FileDialogResult(@"C:\image", fileType); Assert.AreEqual(@"C:\image.bmp", result.GetFullFileName()); result = new FileDialogResult(@"C:\image.txt", fileType); Assert.AreEqual(@"C:\image.txt.bmp", result.GetFullFileName()); result = new FileDialogResult(@"C:\image.txt", fileType); Assert.AreEqual(@"C:\image.txt.bmp", result.GetFullFileName()); }