Ejemplo n.º 1
0
        public void SetUpFixture()
        {
            MockComponentCreator componentCreator = new MockComponentCreator();
            MethodCall           callExpression   = RubyParserHelper.GetMethodCall(code);
            RubyCodeDeserializer deserializer     = new RubyCodeDeserializer(componentCreator);

            args = deserializer.GetArguments(callExpression);
        }
Ejemplo n.º 2
0
        public void EnumReturnedInArgumentsPassedToConstructor()
        {
            string rubyCode = "self.Font = System::Drawing::Font.new(\"Times New Roman\", System::Drawing::FontStyle.Regular, System::Drawing::GraphicsUnit.Point)";
            SimpleAssignmentExpression assignment = RubyParserHelper.GetSimpleAssignmentExpression(rubyCode);

            List <object> expectedArgs = new List <object>();

            expectedArgs.Add("Times New Roman");
            expectedArgs.Add(FontStyle.Regular);
            expectedArgs.Add(GraphicsUnit.Point);

            List <object> args = deserializer.GetArguments(assignment.Right as MethodCall);

            Assert.AreEqual(expectedArgs, args);
        }
        public void NegativeIntegerParameter()
        {
            List <object> expectedArgs = new List <object>();

            expectedArgs.Add(-1);

            string        code           = "TestClass(-1)";
            MethodCall    callExpression = RubyParserHelper.GetMethodCall(code);
            List <object> args           = deserializer.GetArguments(callExpression);

            Assert.AreEqual(expectedArgs, args);
        }