我真的不想添加一个只为我的C#编码的UI测试项目才能调用的F#项目。我宁愿用F#来做整件事。
通过添加subtype Guid或只是正确设置program.fs,可以使用F#项目主机(如果UIMap.uitest文件不起作用,则无关紧要)a { {3}}并将其显示在VS2015测试资源管理器中?
答案 0 :(得分:1)
是。我创建了一个标准的新F#库并添加了以下参考:
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
这个Library1.fs文件:
namespace CodedUITestProject1
open System
open System.Collections.Generic
open System.Text.RegularExpressions
open System.Windows.Input
open System.Windows.Forms
open System.Drawing
open Microsoft.VisualStudio.TestTools.UITesting
open Microsoft.VisualStudio.TestTools.UnitTesting
open Microsoft.VisualStudio.TestTools.UITest.Extension
[<CodedUITest>]
type CodedUITest1 () =
[<TestMethod>]
member this.CodedUITestMethod1() =
Assert.AreEqual(true, true)
()
[<DefaultValue(false)>]
val mutable testContext: TestContext