public void PopupController_ShowSaveErrorDialog_SetProperties_AllPropertiesDisplayed()
{
//------------Setup for test--------------------------
var popupWasCalled = false;
string description = string.Empty;
string header = string.Empty;
MessageBoxButton buttons = MessageBoxButton.YesNoCancel;
MessageBoxImage imageType = MessageBoxImage.Error;
string errorMessage = string.Empty;
var popupController = new PopupController
{
ShowDev2MessageBox = (desc, hdr, btn, img, dntShwAgKy) =>
{
description = desc;
header = hdr;
buttons = btn;
imageType = img;
popupWasCalled = true;
return MessageBoxResult.OK;
}
};
//------------Execute Test---------------------------
popupController.ShowSaveErrorDialog(errorMessage);
//------------Assert Results-------------------------
Assert.IsTrue(popupWasCalled);
Assert.AreEqual(MessageBoxButton.OK, buttons);
Assert.AreEqual("Saving Error", header);
Assert.AreEqual("The following error occurred on save:" + Environment.NewLine + errorMessage, description);
Assert.AreEqual(MessageBoxImage.Error, imageType);
}