コード例 #1
0
        public void OnVisitBuiltInType_called_in_constant_declaration(string dataType, object value)
        {
            var message = $"{dataType} CONST = {value}";
            var expectedPrimitiveType = RosTypeInfo.CreateBuiltIn(dataType);

            var messageParser = ParserHelper.CreateParserForMessage(message);
            var context       = messageParser.ros_message();

            var mock    = new Mock <IRosMessageVisitorListener>();
            var visitor = new RosMessageVisitor(mock.Object);

            visitor.Visit(context);

            mock.Verify(x => x.OnVisitBuiltInType(expectedPrimitiveType));
        }
コード例 #2
0
        public void OnVisitBuiltInType_called_infield_declaration(string dataType)
        {
            var message             = $"{dataType} fieldName";
            var expectedBuiltInType = RosTypeInfo.CreateBuiltIn(dataType);;

            var messageParser = ParserHelper.CreateParserForMessage(message);
            var context       = messageParser.ros_message();

            var mock    = new Mock <IRosMessageVisitorListener>();
            var visitor = new RosMessageVisitor(mock.Object);

            visitor.Visit(context);

            mock.Verify(x => x.OnVisitBuiltInType(expectedBuiltInType));
        }