public void Handle_CallsConverter_WhenCalled()
        {
            // Arrange
            var message = new EndNodeModelChangedMessage();

            // Act
            m_Sut.Handle(message);

            // Assert
            m_Converter.Received().Convert();
        }
        public void Handle_SetsDirectionsInModel_WhenCalled()
        {
            // Arrange
            var expected = Substitute.For <IDisplayNode>();

            var message = new EndNodeModelChangedMessage();

            m_Converter.DisplayNode.Returns(expected);

            // Act
            m_Sut.Handle(message);

            // Assert
            m_MapViewModel.Received()
                          .SetEndNode(expected);
        }
        public void Handle_SetsNodeModelsInConverter_WhenCalled()
        {
            // Arrange
            var expected = Substitute.For <INodeModel>();

            m_Model.Node.Returns(expected);

            var message = new EndNodeModelChangedMessage();

            // Act
            m_Sut.Handle(message);

            // Assert
            Assert.AreEqual(expected,
                            m_Converter.NodeModel);
        }
Ejemplo n.º 4
0
        public void EndNodeModelChangedHandler_SetsNodeModel_WhenCalled()
        {
            // Arrange
            var nodeModel = Substitute.For <INodeModel>();
            m_EndNodeModel.Node.Returns(nodeModel);
            var message = new EndNodeModelChangedMessage();

            // Act
            m_Model.EndNodeModelChangedHandler(message);

            // Assert
            Assert.AreEqual(nodeModel,
                            m_ConverterEndNodeModel.NodeModel);
        }
Ejemplo n.º 5
0
        public void EndNodeModelChangedHandler_CallsConvert_WhenCalled()
        {
            // Arrange
            var message = new EndNodeModelChangedMessage();

            // Act
            m_Model.EndNodeModelChangedHandler(message);

            // Assert
            m_ConverterEndNodeModel.Received().Convert();
        }
Ejemplo n.º 6
0
        public void EndNodeModelChangedHandler_CallsBeginInvoke_WhenCalled()
        {
            // Arrange
            var dispatcher = Substitute.For <IApplicationDispatcher>();
            MapViewModel model = CreateModel(dispatcher);
            var message = new EndNodeModelChangedMessage();

            // Act
            model.EndNodeModelChangedHandler(message);

            // Assert
            dispatcher.Received().BeginInvoke(model.UpdateEndNode);
        }