public void PopupController_ShowSchedulerCloseConfirmation_SetProperties_AllPropertiesDisplayed()
{
//------------Setup for test--------------------------
var popupWasCalled = false;
string description = string.Empty;
string header = string.Empty;
MessageBoxButton buttons = MessageBoxButton.YesNoCancel;
MessageBoxImage imageType = MessageBoxImage.Error;
var expectedDesc = "Scheduler Task has not been saved." + Environment.NewLine
+ "Would you like to save the Task? " + Environment.NewLine +
"-------------------------------------------------------------------" +
"Yes - Save the Task." + Environment.NewLine +
"No - Discard your changes." + Environment.NewLine +
"Cancel - Returns you to Scheduler.";
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.ShowSchedulerCloseConfirmation();
//------------Assert Results-------------------------
Assert.IsTrue(popupWasCalled);
Assert.AreEqual(MessageBoxButton.YesNoCancel, buttons);
Assert.AreEqual("Scheduler Task has changes", header);
Assert.AreEqual(expectedDesc, description);
Assert.AreEqual(MessageBoxImage.Information, imageType);
}