给出一个简单的F#控制台应用:
[<EntryPoint>]
let main argv =
printfn "Hello world"
Console.ReadLine() |> ignore
0
Run Code Online (Sandbox Code Playgroud)
我需要做什么才能以与ctrl F5在Visual Studio中相同的方式启动控制台应用程序.我尝试使用Fake.ProcessHelper从FAKE构建脚本运行它:
Target "Run" (fun _ ->
let exe = @"C:\Source\code\fs_console_app\build\fs_console_app.exe"
let errorCode = Shell.AsyncExec(exe, "", buildDir)
()
)
Run Code Online (Sandbox Code Playgroud)
点击Ctrl F5我收到以下构建报告:
Target Duration
------ --------
Build 00:00:00.3916039
Run 00:00:00.0743197
Total: 00:00:00.5605493
Status: Ok
Run Code Online (Sandbox Code Playgroud)
但没有控制台应用程序启动和等待输入的迹象.
我正在尝试为一个类(在.net Core项目中)编写一个xunit测试,它看起来像:
public Class FoodStore:IFoodStore
{
FoodList foodItems;
public FoodStore(IOptions<FoodList> foodItems)
{
this.foodItems = foodItems;
}
public bool IsFoodItemPresentInList(string foodItemId)
{
//Logic to search from Food List
}
}`
Run Code Online (Sandbox Code Playgroud)
注意:FoodList实际上是一个包含数据的json文件,它在Startup类中加载和配置.
如何编写带有适当依赖注入的xunit测试来测试IsFoodItemPresentInList方法?
dependency-injection xunit xunit.net asp.net-core asp.net-core-1.0
调用以下 AWS CLI SDK 命令会触发 shell 提示输入一系列值:
$ aws configure --profile profilename
Run Code Online (Sandbox Code Playgroud)
$ AWS 访问密钥 ID [无]:等等......
有什么办法可以指定行内的参数吗?例如
$ aws configure --profile profilename --access-key=foo --access-secret=goo --region=bar
Run Code Online (Sandbox Code Playgroud)
感谢 Michael McD 的副手