コード例 #1
0
        [Test] public void CleanUp_UnsubscribedFromVMGotoMessage()
        {
            var vm = new ChatAreaViewModel(
                _messageLoaderMock.Object,
                _receiverHub,
                _vmMessengerMock.Object);

            vm.Cleanup();

            _vmMessengerMock.Verify(m =>
                                    m.Unregister <GoToMessageInnerMessage>(vm),
                                    Times.Once);
        }
コード例 #2
0
        [Test] public void CleanUp_MessagesIsEmpty()
        {
            var vm = new ChatAreaViewModel(
                _messageLoaderMock.Object,
                _receiverHub,
                _vmMessengerMock.Object);

            TestsHelper.FillMessages(vm, 3, 2);

            vm.Cleanup();

            Assert.IsEmpty(vm.Messages);
        }
コード例 #3
0
        [Test] public void CleanUp_UnsubscribedFromMessagesReceiver()
        {
            var receiverHubMock = new Mock <IReceiverHub>();
            var vm = new ChatAreaViewModel(
                _messageLoaderMock.Object,
                receiverHubMock.Object,
                _vmMessengerMock.Object);

            vm.Cleanup();

            receiverHubMock.Verify(m =>
                                   m.UnsubscribeMessageReceived(vm),
                                   Times.Once);
        }