コード例 #1
0
        public void ManageLoginsPresenter_Should_Initialize_A_Object()
        {
            var mockedView = new Mock <IManageLoginsView>();
            var presenter  = new ManageLoginsPresenter(mockedView.Object);

            Assert.IsInstanceOf <ManageLoginsPresenter>(presenter);
        }
コード例 #2
0
        public void ManageLoginsPresenter_Should_Set_SuccessMessageVisible_To_False()
        {
            var mockedView = new Mock <IManageLoginsView>();

            mockedView.SetupAllProperties();
            mockedView.SetupGet(v => v.GetLoginsCount).Returns(0);

            var presenter = new ManageLoginsPresenter(mockedView.Object);

            mockedView.Raise(v => v.Load += null, new EventArgs());

            Assert.AreEqual(false, mockedView.Object.SuccessMessageVisible);
        }
コード例 #3
0
        public void ManageLoginsPresenter_Should_Set_CanRemoveExternalLogins_To_True()
        {
            var mockedView = new Mock <IManageLoginsView>();

            mockedView.SetupAllProperties();
            mockedView.SetupGet(v => v.GetLoginsCount).Returns(10);

            var presenter = new ManageLoginsPresenter(mockedView.Object);

            mockedView.Raise(v => v.Load += null, new EventArgs());

            Assert.AreEqual(true, mockedView.Object.CanRemoveExternalLogins);
        }