public void AddContext_GivenContext_AddsContextToCollection()
        {
            PatientNodePresenter presenter = GetPresenter();

            presenter.AddContext(TestUtilities.GetPatientContext());
            Assert.AreNotEqual(_zeroCount, presenter.Contexts.Count);
        }
        public void Constructor_GivenPatientNodeView_InitializesView()
        {
            var mockPatientNodeView = new Mock <IPatientNodeView>();
            PatientNodePresenter patientNodePresenter = GetPresenter(mockPatientNodeView.Object);

            Assert.IsNotNull(patientNodePresenter.PatientNodeView);
            Assert.AreEqual(mockPatientNodeView.Object, patientNodePresenter.PatientNodeView);
        }
        public void AddContext_GivenSameContextTwice_AddsOnlyOne()
        {
            PatientNodePresenter presenter = GetPresenter();
            var patientContext             = TestUtilities.GetPatientContext();

            presenter.AddContext(patientContext);
            presenter.AddContext(patientContext);
            Assert.AreEqual(_oneCount, presenter.Contexts.Count);
        }
        public void RemoveContext_GivenContext_RemovesFromContextCollection()
        {
            PatientNodePresenter presenter = GetPresenter();
            PatientContext       context   = TestUtilities.GetPatientContext();

            presenter.AddContext(context);
            Assert.AreEqual(_oneCount, presenter.Contexts.Count);
            presenter.RemoveContext(context);
            Assert.AreEqual(_zeroCount, presenter.Contexts.Count);
        }
 private static PatientNodePresenter GetPresenter(IPatientNodeView mockPatientNodeView)
 {
     var patientNodePresenter = new PatientNodePresenter(mockPatientNodeView);
     return patientNodePresenter;
 }
        private static PatientNodePresenter GetPresenter(IPatientNodeView mockPatientNodeView)
        {
            var patientNodePresenter = new PatientNodePresenter(mockPatientNodeView);

            return(patientNodePresenter);
        }
        public void RemoveContext_GivenNull_ThrowsArgumentNullException()
        {
            PatientNodePresenter presenter = GetPresenter();

            presenter.RemoveContext(null);
        }