public void Handle_CallsConverter_WhenCalled() { // Arrange var message = new NodesModelChangedMessage(); // Act m_Sut.Handle(message); // Assert m_Converter.Received().Convert(); }
public void Handle_SetsNodeModelsInConverter_WhenCalled() { // Arrange var expected = new[] { Substitute.For <INodeModel>() }; m_Model.Nodes.Returns(expected); var message = new NodesModelChangedMessage(); // Act m_Sut.Handle(message); // Assert Assert.AreEqual(expected, m_Converter.NodeModels); }
public void Handle_SetsDirectionsInModel_WhenCalled() { // Arrange var expected = new[] { Substitute.For <IDisplayNode>() }; var message = new NodesModelChangedMessage(); m_Converter.DisplayNodes.Returns(expected); // Act m_Sut.Handle(message); // Assert m_MapViewModel.Received() .SetNodes(expected); }
public void NodesModelChangedHandler_SetsNodeModel_WhenCalled() { // Arrange IEnumerable <INodeModel> nodeModels = new[] { Substitute.For <INodeModel>() }; m_NodesModel.Nodes.Returns(nodeModels); var message = new NodesModelChangedMessage(); // Act m_Model.NodesModelChangedHandler(message); // Assert Assert.AreEqual(nodeModels, m_ConverterNodes.NodeModels); }
public void NodesModelChangedHandler_CallsConvert_WhenCalled() { // Arrange var message = new NodesModelChangedMessage(); // Act m_Model.NodesModelChangedHandler(message); // Assert m_ConverterNodes.Received().Convert(); }
public void NodesModelChangedHandler_CallsBeginInvoke_WhenCalled() { // Arrange var dispatcher = Substitute.For <IApplicationDispatcher>(); MapViewModel model = CreateModel(dispatcher); var message = new NodesModelChangedMessage(); // Act model.NodesModelChangedHandler(message); // Assert dispatcher.Received().BeginInvoke(model.UpdateNodes); }