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

            m_Bus.PublishAsync(message);
        }
コード例 #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();
        }
コード例 #3
0
        public void QueryPointSetHandler_SetsZ_ForMessage(
            [NotNull] QueryPointModel sut,
            [NotNull] QueryPointSetMessage message)
        {
            // Arrange
            // Act
            sut.QueryPointSetHandler(message);

            // Assert
            Assert.AreEqual(message.Z,
                            sut.Z);
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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);
        }