首页 \ 问答 \ FitNesse:使用SetUp页面的流模式在.NET中定义封闭表(FitNesse: Flow Mode using SetUp page to define enclosing table in .NET)

FitNesse:使用SetUp页面的流模式在.NET中定义封闭表(FitNesse: Flow Mode using SetUp page to define enclosing table in .NET)

我正在使用FitNesse (PDF)通过电子书测试驱动的.NET开发工作,我遇到了使用带有DoFixture的流程模式创建测试页面的问题(第8章协调装置)。 按照本章中的教程,您可以使用流模式创建测试页,然后重构它以将设置(包括前两个表)移动到单独的SetUp页面中(重构从本书的第99页开始)。

我能够成功创建初始流模式测试页面,但我无法通过单独的SetUp页面获得重构版本。 我想我错过了一些明显但我看不到的东西。

以下是SettlementTests.SetUp的内容:

!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer %p}
!define TEST_RUNNER {FitSharp\Runner.exe}
!path C:\...\Tristan.Test.dll

!|Tristan.Test.SettlementTest|

|Accounts before the draw|
|player|balance|
|Arthur|100|
|Ford|100|
|Trisha|100|
|Marvin|100|

这是SettlementTests.OneWinnerSixBallsFirstTry页面:

|Tickets in the Draw|
|player|numbers|value|
|Ford|2,11,22,33,39,18|50|
|Arthur|1,5,4,7,9,20|50|
|Trisha|10,21,30,6,16,26|50|
|Marvin|12,13,14,15,16,17|50|

|Draw results are|1,5,4,20,9,7|

|Accounts after the Draw|
|Player|Balance?|
|Arthur|118|
|Ford|50|
|Trisha|50|
|Marvin|50|

对于每个表我收到错误消息:

找不到夹具:Tristan.Test.SettlementTest。

(或表中指定的任何夹具名称)

我创建了一个父级SettlementTests套件页面,并尝试将SetUp页面设置为静态页面和测试页面。 在这两种情况下我都得到了相同的结果。 类路径与有效的一体化页面相同。

当我在SetUp页面中定义封闭表时,我需要做些什么来使流模式工作吗?


I'm working my way through the eBook Test Driven .NET Development with FitNesse (PDF) and I've run into a problem creating a test page using flow mode with a DoFixture (Chapter 8 Coordinating fixtures). Following through the tutorial in the chapter you create a test page using flow mode then refactor it to move the setup, including the first two tables, into a separate SetUp page (the refactoring starts on page 99 of the book).

I was able to create the initial flow mode test page successfully but I can't get the refactored version working, with the separate SetUp page. I figure I'm missing something obvious but I can't see it.

Here is the contents of SettlementTests.SetUp:

!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer %p}
!define TEST_RUNNER {FitSharp\Runner.exe}
!path C:\...\Tristan.Test.dll

!|Tristan.Test.SettlementTest|

|Accounts before the draw|
|player|balance|
|Arthur|100|
|Ford|100|
|Trisha|100|
|Marvin|100|

And this is the SettlementTests.OneWinnerSixBallsFirstTry page:

|Tickets in the Draw|
|player|numbers|value|
|Ford|2,11,22,33,39,18|50|
|Arthur|1,5,4,7,9,20|50|
|Trisha|10,21,30,6,16,26|50|
|Marvin|12,13,14,15,16,17|50|

|Draw results are|1,5,4,20,9,7|

|Accounts after the Draw|
|Player|Balance?|
|Arthur|118|
|Ford|50|
|Trisha|50|
|Marvin|50|

For each table I'm getting the error message:

Could not find fixture: Tristan.Test.SettlementTest.

(or whatever the fixture name specified in the table is)

I've created a parent SettlementTests suite page, and tried setting the SetUp page as both a Static page and as a Test page. I get the same results in both cases. The classpath is the same as the all-in-one page that works.

Is there something special I need to do to get flow mode working when I define the enclosing table in the SetUp page?


原文:https://stackoverflow.com/questions/39558211
更新时间:2022-04-10 06:04

最满意答案

您正在错误地处理从JSON字符串创建的PHP对象中的数据

$json = file_get_contents('https://...link/here..');
$obj = json_decode($json);
echo $obj->data[0]->Position;

或者如果有更多的发生

foreach ( $obj->data as $idx=>$data) {
    echo $data->Position;
}

You are incorrectly addressing the data in the PHP object created from the JSON String

$json = file_get_contents('https://...link/here..');
$obj = json_decode($json);
echo $obj->data[0]->Position;

Or if there are more occurances

foreach ( $obj->data as $idx=>$data) {
    echo $data->Position;
}

相关问答

更多
  • 您正在错误地处理从JSON字符串创建的PHP对象中的数据 $json = file_get_contents('https://...link/here..'); $obj = json_decode($json); echo $obj->data[0]->Position; 或者如果有更多的发生 foreach ( $obj->data as $idx=>$data) { echo $data->Position; } You are incorrectly addressing the da ...
  • 从PHP手册 如果无法解码json或编码数据深于递归限制,则返回NULL 由于您没有指定递归限制,因此可能是您的JSON无效或者没有从您的URL中检索任何内容。 要尝试三件事: 确定是否存在json_decode错误 print_r(json_last_error()); // call after json_decode 检查是否正在返回数据 print_r($url); 查看数据是否将作为对象进行解码 $obj = json_decode($url); print_r($obj); From PHP M ...
  • 看起来你对数据结构感到困惑。 你的最后一个循环是错误的,我认为它应该是这样的: $fix = $fixture_array->SoticFeed->Fixtures->Fixture; foreach($fix as $fix_detail){ foreach($fix_detail->Teams->Team as $team){ print $team->TmnmDisplay . "
    "; } } 这假设您要显示所有团队的名称。 如果这不是您的意图,请告诉我。 ...
  • http://ksupulse.tk/get_all.php不起作用,堆栈跟踪显示“没有这样的文件”,所以请确保您传递的是正确的链接。 使用http://www.jsoneditoronline.org/等网站查看确切的内容。 在解析JSON时,错误发生在MainActivity类中。 “解析数据时出错org.json.JSONException:java.lang.String类型的值无法转换为JSONObject”。 你的行JSONObject c = user.getJSONObject(0); 需要 ...
  • jQuery.ajax dosen't用关键data你的自定义数据,关键字来自你的数据。 例如,如果您的数据是: data: {foo: "Bar"} 然后$_POST['foo']会给你Bar 。 如果你想用$_POST['data']得到整个数据,你必须先设置键。 $.ajax({ data: { data: data }, type: 'POST', url: '/dashboard/example.php', }); 现在您的$_POST将拥有data密钥。 无论你想要 ...
  • 我发现了我的错误。 如果您遇到过这种情况,请记住您必须在发送的数据中添加参数。 我错误地认为我已经在发送参数,而他们已经使用JSON进行编码。 在我的示例中,您只需在AJAX请求中添加名称(此处为“datas”),如此data : {datas : choice} 。 这是工作代码 : $.ajax({ type : "GET", url : "ajax/order.php", dataType: "JSON", data : {datas : choices} , success: ...
  • 有一个内置函数来解析参数字符串: parse_str() alter [param] => Array ( [key1] => value1 [key2] => ...
  • 你走在正确的轨道上。 :只是属性的无效字符,必须处理特殊。 echo $json->{'ISBN:9781430215752'}->info_url; 会得到你预期的结果。 You are on the right track. : is just an invalid character for a property and must be handled special. echo $json->{'ISBN:9781430215752'}->info_url; will get you the e ...
  • 如果您访问目标URL,您会注意到JSON值包含在一个回调方法中,您可以通过类似的方式进行修剪 $json = str_replace('finance_charts_json_callback(', '', substr($pageContent, 0, strlen($pageContent) - 1)); 以下是它们看起来如何组合在一起:
  • Json和Jsonp是两个不同但相关的东西。 使用json修改你的javascript ...(json默认为jQuery) $.ajax({ url: 'https://XXXXXXXXX.net/json.php', timeout: 5000, success: function(data, status){ } }); 使用jsonP与您现有的JavaScript,修改您的服务器代码... header("Access-Control-Allow-Origin: *" ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)