fitSharp.Machine.Exception.TypeMissingException:程序集中找不到类型'a1'

时间:2019-06-21 02:44:40

标签: .net fitnesse

尝试重现一个简单的FitNesse示例,遇到此“ TypeMissingException”问题。

试图指定完整路径,没有区别。路径似乎工作正常。识别灯具中的类别(FitnessTest.Multiply);但是无法识别类public int a1;上的变量,但会生成标题中的异常。

测试页:


    !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,fitsharp\bin\fit.dll %p}
    !define TEST_RUNNER {fitsharp\bin\Runner.exe}
    !path test\bin\FitnesseTest.dll

    !| FitnesseTest.Multiply |
    | a1 | a2 | Times? |
    | 10 | 2 | 20 |
    | 12 | 3 | 36 |
    | 100 | 4 | 33 |

修复:


    namespace FitnesseTest
    {
        public class Multiply : fit.ColumnFixture
        {
            public int a1;
            public int a2;

            public int Times()
            {
                return a1 * a2;
            }
        }
    }

结果:


    Test Pages: 0 right, 0 wrong, 0 ignored, 0 exceptions     Assertions: 0 right, 0 wrong, 0 ignored, 1 exceptions (0.609 seconds)

    variable defined: COMMAND_PATTERN=%m -r fitnesse.fitserver.FitServer,fitsharp\bin\fit.dll %p 
    variable defined: TEST_RUNNER=fitsharp\bin\Runner.exe 
    classpath: test\bin\FitnesseTest.dll

    FitnesseTest.Multiply
    a1
    fitSharp.Machine.Exception.TypeMissingException: Type 'a1' not found in assemblies:
        file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
        file:///E:/dev/FitNesse/fitsharp/bin/Runner.exe
        file:///E:/dev/FitNesse/fitsharp/bin/fitSharp.DLL
        file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
        file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
        file:///E:/dev/FitNesse/fitsharp/bin/fit.DLL
        file:///E:/dev/FitNesse/test/bin/FitnesseTest.dll

etc.

1 个答案:

答案 0 :(得分:0)

您的测试中是否还有空白行?当我运行此处发布的测试时,它运行正常。如果在灯具名称后面加了一个空白行,则可以重现您的问题:

!| FitnesseTest.Multiply |

| a1 | a2 | Times? |
| 10 | 2 | 20 |
| 12 | 3 | 36 |
| 100 | 4 | 33 |