Example #1
0
        internal void SendQueryPointSetMessage()
        {
            var message = new QueryPointSetMessage
            {
                X = X,
                Y = Y,
                Z = Z
            };

            m_Bus.PublishAsync(message);
        }
Example #2
0
        internal void QueryPointSetHandler(QueryPointSetMessage message)
        {
            var queryPoint = new Point3D(-1,
                                         message.X,
                                         message.Y,
                                         message.Z,
                                         "Query Point");

            m_Manager.QueryPoint = queryPoint;

            SendQueryPointChangedMessage();
        }
        public void QueryPointSetHandler_SetsZ_ForMessage(
            [NotNull] QueryPointModel sut,
            [NotNull] QueryPointSetMessage message)
        {
            // Arrange
            // Act
            sut.QueryPointSetHandler(message);

            // Assert
            Assert.AreEqual(message.Z,
                            sut.Z);
        }
        public void QueryPointSetHandler_SendsMessage_ForMessage(
            [NotNull, Frozen] ISelkieInMemoryBus bus,
            [NotNull] QueryPointModel sut,
            [NotNull] QueryPointSetMessage message)
        {
            // Arrange
            // Act
            sut.QueryPointSetHandler(message);

            // Assert
            bus.Received().PublishAsync(Arg.Is <QueryPointChangedMessage>(x => Math.Abs(x.X - message.X) < Tolerance &&
                                                                          Math.Abs(x.Y - message.Y) < Tolerance &&
                                                                          Math.Abs(x.Z - message.Z) < Tolerance));
        }
        private void SetXyzValues(
            [NotNull] QueryPointModel model,
            double x,
            double y,
            double z)
        {
            var setMessage = new QueryPointSetMessage
            {
                X = x,
                Y = y,
                Z = z
            };

            model.QueryPointSetHandler(setMessage);
        }