public void send_observer_message() { // Setup var viewModel = new ViewModel(); viewModel.Observer = new Observer(); // Test viewModel.SendMessage.Execute(null); // Verify var expected = viewModel.Observer.Messages.Any(); Assert.IsTrue(expected); }
public void receive_observer_message() { // Setup var viewModel = new ViewModel(); viewModel.Observer = new Observer(); var observer = viewModel.Observer; var provider = viewModel.Provider; var message = new Message(observer.Id, new List<string>() { provider.Id }, SOME_TEXT); // Test observer.Send(message); // Verify var expected = provider.Messages.Count() == 1; Assert.IsTrue(expected); }