小编Chr*_*elt的帖子

SpecFlow可重复使用的步骤定义

有没有办法让SpecFlow重用步骤定义?

在其他工具中,我使用了包含诸如的方法的GivenWhenThen基类

WhenAnOrderIsCreated - 这将通过继承类来使用受保护的订单成员.

似乎无法使用SpecFlow(似乎不喜欢继承)

有没有办法分享各个功能的步骤?

非常感谢

c# bdd specflow

14
推荐指数
1
解决办法
9020
查看次数

F#Global.asax - 不支持语言?

我试着写一个简单的F#ASP.Net MVC应用程序

我添加了Global.asax,如下所示

<%@ Application Inherits="WebApplication.Core.Global" Language="F#" %>
Run Code Online (Sandbox Code Playgroud)

然后我在一个单独的引用程序集中

namespace WebApplication.Core  with a type Global() = etc
Run Code Online (Sandbox Code Playgroud)

获取'F#'不是受支持的语言.

我不能这样做吗?

谢谢

asp.net-mvc f# global-asax

8
推荐指数
1
解决办法
574
查看次数

自动传递器继承 - 重用地图

我试图使用automapper为父对象创建一个映射,并在其子对象中重用它.

对于子属性,我只想映射额外的字段.

这可能吗?我的代码看起来像这样

CreateCalculationMap(message);  ---- This does the BASE parent mappping.
    Mapper.CreateMap<QuoteMessage, CalculationGipMessage>()                     -- This is the child.
        .Include<QuoteMessage, CalculationBase>()                               -- Include the parent?
        .ForMember(a => a.OngoingCommission, b => b.MapFrom(c => c.OngoingASF)) - Child
        .ForMember(a => a.SpecialRate, b => b.MapFrom(c => c.BlahBlah)));       - Child
Run Code Online (Sandbox Code Playgroud)

为什么它一直告诉我父母属性没有映射?然而,我以为我把它们包含在CreateCalculationMap(消息)中; 其中包含

Mapper.CreateMap<QuoteMessage, CalculationBase>() ()
Run Code Online (Sandbox Code Playgroud)

c# automapper

8
推荐指数
1
解决办法
3713
查看次数

Visual Studio 2008 Post Build事件 - 仅在Rebuild上运行

在Visual Studio 2008中,我们运行一个post build事件,该事件调用NANT,然后创建我们的配置文件.

例如

if $(SolutionDir) == . GOTO end
nant -buildfile:$(SolutionDir)default.build create..web.config
Run Code Online (Sandbox Code Playgroud)

有没有办法只在ReBuild上运行它?

rebuild visual-studio build-events

6
推荐指数
1
解决办法
1829
查看次数

Specflow插件:生成错误:缺少[assembly:GeneratorPlugin]属性

我正在编写一个自定义插件来自定义SpecFlow生成的自动生成的代码文件.

构建解决方案并将其放入SpecFlow测试项目的"lib"文件夹之后.在保存我得到的SpecFlow功能文件时

Specflow plugin : Generation error: Missing [assembly:GeneratorPlugin] attribute in 'path to dll'
Run Code Online (Sandbox Code Playgroud)

即使我在插件程序集中标记了这一点

[assembly: GeneratorPluginAttribute(typeof(CustomGeneratorPlugin))]
Run Code Online (Sandbox Code Playgroud)

使用反射/自我测试我可以自己加载程序集并解析属性

代码在这里 - https://github.com/chrismckelt/SpecFlowCustomPlugin

有什么想法导致这个?谢谢

c# xunit .net-assembly specflow

5
推荐指数
1
解决办法
3198
查看次数

Autofac:网站重启后的ComponentNotRegisteredException

我有一个奇怪的错误.将DLL上传到bin文件夹后,我的网站正常工作.

然后我离开它一段时间(或从我的共享主机控制面板触发网站重启)

我收到以下错误

The requested service 'Nop.Core.Data.DataSettings' has not been registered. To avoid  this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.


[ComponentNotRegisteredException: The requested service 'Nop.Core.Data.DataSettings'  has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.]
   Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, …
Run Code Online (Sandbox Code Playgroud)

c# autofac nopcommerce

4
推荐指数
1
解决办法
9557
查看次数

System.Linq.Enumerable.OfType <T> - 是否有F#方式?

我正在寻找使用F#WSDL类型提供程序.要调用我正在使用的Web服务,我需要将我的客户端凭据附加到System.ServiceModel.Description.ClientCredentials.

这是我的C#代码:

var serviceClient = new InvestmentServiceV1Client.InvestmentServiceV1Client();

foreach (ClientCredentials behaviour in serviceClient.Endpoint.Behaviors.OfType<ClientCredentials>())
{
    (behaviour).UserName.UserName = USERNAME;
    (behaviour).UserName.Password = PASSWORD;
    break;
}
Run Code Online (Sandbox Code Playgroud)

这是我到目前为止的F#代码:

let client = new service.ServiceTypes.InvestmentServiceV1Client()
let xxx = client.Endpoint.Behaviors
|> Seq.choose (fun p -> 
    match box p with   
    :?   System.ServiceModel.Description.ClientCredentials as x -> Some(x) 
    _ -> None) 
|> (System.ServiceModel.Description.ClientCredentials)p.UserName.UserName = USERNAME
Run Code Online (Sandbox Code Playgroud)

是否有F#相当于System.Linq.Enumerable.OfType<T>或者我应该使用raw OfType<T>

f# c#-to-f# type-providers

2
推荐指数
1
解决办法
274
查看次数

PSAKE powershell&执行任务未运行

试图让PSAKE脚本工作.似乎任务没有执行其中的功能?

我有2个文件

-- default.ps1 --
Import-Module "C:\dev\Phoenix\trunk\Build\BuildScripts\include.ps1"
Import-Module "C:\Software\PSAKE\JamesKovacs-psake-b0094de\psake.psm1"
Invoke-psake "C:\dev\Phoenix\trunk\Build\BuildScripts\build.ps1"
remove-module psake


-- build.ps1 --
$framework = '4.0'

properties {
    $root_dir = 'c:\dev\Phoenix\trunk\'
    $integration_deploy_dir = '\\Server025\Phoenix_IntegrationTests\'
    $build_scripts_dir = '$root_dir\Build\BuildScripts'
    $test_dir =  Join-Path $root_dir '\Tests\Core.UnitTests\bin\Debug'
    $dll = Join-Path $test_dir 'Phoenix.Core.UnitTests.dll'
} 


task default -depends Test

task MsBuild {  exec { msbuild /version }}

task Test -depends Deploy
{
    Write-Host "Start task Test"
Add-PSSnapIn Gallio
Write-Host "TEST --  $dll" 
Test-Gallio $test_dir Release x64 $dll "Core.UnitTests"     ## FYI - call to include …
Run Code Online (Sandbox Code Playgroud)

powershell build psake

1
推荐指数
1
解决办法
1651
查看次数