public void PopupController_ShowNotConnected_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 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.ShowNotConnected();
//------------Assert Results-------------------------
Assert.IsTrue(popupWasCalled);
Assert.AreEqual(MessageBoxButton.OK, buttons);
Assert.AreEqual("Server is not connected", header);
Assert.AreEqual("You can not change the settings for a server that is offline.", description);
Assert.AreEqual(MessageBoxImage.Error, imageType);
}