[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); }
[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); }
[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); }