public void Test_BusinessObjectEdited_ShouldRefreshTheValueInTheList()
{
//---------------Set up test pack-------------------
ClassDef.ClassDefs.Clear();
MyBO.LoadDefaultClassDef();
var listBox = GetControlFactory().CreateListBox();
var manager = CreateListBoxCollectionManager(listBox);
var boToBeUpdated = new MyBO();
var myBoCol = new BusinessObjectCollection<MyBO> {new MyBO(), boToBeUpdated };
manager.BusinessObjectCollection = myBoCol;
manager.Control.SelectedItem = boToBeUpdated;
var initialListBoxDisplayText = manager.Control.Text;
var initialBOToString = boToBeUpdated.ToString();
//---------------Assert Precondition----------------
Assert.AreEqual(2, manager.Control.Items.Count);
Assert.AreSame(boToBeUpdated, manager.Control.Items[1]);
Assert.AreEqual(initialBOToString, initialListBoxDisplayText);
//---------------Execute Test ----------------------
boToBeUpdated.TestProp = GetRandomString();
boToBeUpdated.Save();
//---------------Test Result -----------------------
var updatedListBoxDisplayText = manager.Control.Text;
var updatedBOToString = boToBeUpdated.ToString();
Assert.AreNotEqual(initialListBoxDisplayText, updatedListBoxDisplayText);
Assert.AreNotEqual(initialBOToString, updatedBOToString);
Assert.AreEqual(updatedBOToString, updatedListBoxDisplayText);
}