public void NameAccessor() { // Create a new Mediator and use accessors to set the mediator name IMediator mediator = new Mediator("TestMediator"); // test assertions Assert.IsTrue(mediator.MediatorName == "TestMediator", "Expecting mediator.MediatorName == 'TestMediator'"); }
public void ViewAccessor() { // Create a view object object view = new object(); // Create a new Proxy and use accessors to set the proxy name IMediator mediator = new Mediator("TestMediator", view); // test assertions Assert.IsNotNull(mediator.ViewComponent, "Expecting mediator.ViewComponent not null"); }
public void HasMediator() { // register a Mediator IView view = View.Instance; // Create and register the test mediator string name = "HasMediatorTest" + Thread.CurrentThread.Name; Mediator mediator = new Mediator(name, this); view.RegisterMediator(mediator); // assert that the view.hasMediator method returns true // for that mediator name Assert.IsTrue(view.HasMediator(name) == true, "Expecting view.hasMediator(name) == true"); view.RemoveMediator(name); // assert that the view.hasMediator method returns false // for that mediator name Assert.IsTrue(view.HasMediator(name) == false, "Expecting view.hasMediator(name) == false"); }