自NCrunch离开自由市场以来,我一直在寻找类似工具进行代码覆盖标记,以及像NCrunch这样的连续测试
编辑:我正在使用VS2012
更新:
我一直在使用ContinuousTest一段时间,没关系,但我认为在编写代码时缺乏反馈.当我编写测试时,反馈很好,但是当我打破测试时(编辑源代码时),它不会告诉我测试中断(在边缘,就像它对NCrunch一样).所以,如果有人知道其他工具,我仍然在听.
在日常使用中,NCrunch与ReSharper的合作程度如何?它们可以并排运行而没有任何(可用的)故障吗?表现还行吗?有什么值得注意的吗?ReSharper测试人员是否还能工作?
我正在寻找一种在Eclipse中为Java编写代码(例如NCrunch for Visual Studio)时进行连续测试的工具.有免费的东西吗?
理想情况下,它会连续测试,但也会实时反馈哪些线路通过,哪些线路不通过.
"底线":你如何设置NCrunch以排除某个类别中的所有测试,例如"LongRunning"?
Stack Overflow 搜索结果为零,相关的NCrunch wiki页面只是告诉我" NUnit的Category属性和NCrunch一样强大 ",这很好但不告诉我如何使用这些类别.
为了进一步澄清,我期待一个复选框列表可以打开/关闭类别,类似于NUnit Test Runner中的/exclude选项,以排除某些类别中的所有测试.
PS.我只用NCrunch标记了这个问题,我使用NUnit作为我的测试框架似乎并不重要.如果答案另有说明,我很乐意添加标签.
我正在使用Ninject.Extensions.Factory和Ninject 3创建一个工厂,它IFoo根据提供给工厂的字符串创建不同类型的工厂.我有一个通过单元测试,但奇怪的是,只有在Resharper测试运行器.在NCrunch测试运行器中,它失败了.这是一个NCrunch配置问题,还是我需要更改代码?
界面:
public interface IFooFactory
{
IFoo CreateFoo(string name);
}
Run Code Online (Sandbox Code Playgroud)
Ninject绑定:
kernel.Bind<IFooFactory>().ToFactory(() => new UseFirstParameterAsNameInstanceProvider());
kernel.Bind<IFoo>().To<BarFoo>().Named("Bar");
Run Code Online (Sandbox Code Playgroud)
考试:
[Test]
public void CanCreateFooTest()
{
var factory = (IFooFactory) Kernel.GetService(typeof(IFooFactory));
var bar = factory.CreateFoo("Bar");
Assert.AreEqual(typeof(BarFoo), bar.GetType());
}
Run Code Online (Sandbox Code Playgroud)
和NCrunch异常:
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> Ninject.ActivationException : Error activating IInterceptor using conditional implicit self-binding of IInterceptor
Provider returned null.
Activation path:
2) Injection of dependency IInterceptor into parameter of constructor of type IFooFactoryProxy
1) …Run Code Online (Sandbox Code Playgroud) 我正在尝试在nCrunch中设置selenium测试,它将测试输出到自己的临时文件夹.
我在创建驱动程序(new PhantomJSDriver())时遇到以下错误:
OpenQA.Selenium.DriverServiceNotFoundException:PhantomJS.exe文件不存在于当前目录或PATH环境变量的目录中.
但是我已检查并PhantomJS.exe确实存在于当前目录(\ bin\debug)中.
然后我尝试使用new PhantomJSDriver(".\\")哪个应该是当前目录,并且确实有效.
Selenium在这条消息中指的是什么是"当前目录"?
我正在研究我的项目的常量集,我想使用roslyn在源代码级别验证它们中的一些.要做到这一点,我加载使用下面的片段到整个解决方案与应用程序域IsFullyTrusted == true和IsHomogenous == true,即远程启动与x86平台的目标:
// load workspace, i.e. solution from Visual Studio
var workspace = Roslyn.Services.Workspace.LoadSolution(solutionFile);
Run Code Online (Sandbox Code Playgroud)
但是当使用ncrunch 1.45或nunit 2.6.2 nunit-console-x86.exe以及平台配置x86作为测试运行时,我会不断得到以下内容System.Security.SecurityException:
System.Security.SecurityException : Type System.Runtime.Remoting.ObjRef and the types derived from it (such as System.Runtime.Remoting.ObjRef) are not permitted to be deserialized at this security level.
Server stack trace:
at System.Runtime.Serialization.FormatterServices.CheckTypeSecurity(Type t, TypeFilterLevel securityLevel)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)
at …Run Code Online (Sandbox Code Playgroud) Visual Studio 2015经常变得奇怪.
键入的键以半随机顺序出现,有时我必须按键两次或更多次.
我认为这似乎是关键词,而不是变量名或文字.
大约五分钟后,我将收到错误对话框,告诉我有一个可能由扩展引起的异常.
参赛作品ActivityLog.xml如下:
<entry>
<record>762</record>
<time>2015/08/11 20:17:02.056</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidOperationException: IWpfTextView has not completed its layout.
 at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot, SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportWidth, Double effectiveViewportHeight, Boolean preserveViewportTop, Nullable`1 cancel)
 at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.DisplayTextLineContainingBufferPosition(SnapshotPoint bufferPosition, Double verticalDistance, ViewRelativePosition relativeTo, Nullable`1 viewportWidthOverride, Nullable`1 viewportHeightOverride)
 at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.DisplayTextLineContainingBufferPosition(SnapshotPoint bufferPosition, Double verticalDistance, ViewRelativePosition relativeTo)
 at Microsoft.VisualStudio.Text.InterTextAdornmentSupport.Implementation.InterLineAdornmentManager.PerformLayout(SnapshotPoint trackingPoint)
 at Microsoft.VisualStudio.Text.InterTextAdornmentSupport.Implementation.InterLineAdornmentManager.OnBatchedTagsChanged(Object sender, BatchedTagsChangedEventArgs e)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs …Run Code Online (Sandbox Code Playgroud) resharper visual-studio visual-studio-extensions ncrunch visual-studio-2015
我们有一些UI测试使用FlaUI来自动化与Windows UI的交互.
当我们在构建服务器上运行这些测试时,除非有人通过RDP连接,否则它们无法与UI交互.
我们从测试中得到的错误只是一个 Could not send mouse input. ErrorCode: 5
机器设置为在启动时登录用户,如果我们以该用户身份登录到RDP会话并"观察"测试,那么它们运行正常并且可以与桌面交互.一旦我们断开该用户,他们就会再次无法进行交互.
我们使用NCrunch网格节点控制台应用程序通过NCrunch网格节点运行测试,该应用程序在登录时启动(即它不作为服务运行,因此它可以与桌面交互).
有没有办法让测试以一种方式运行,这意味着我们不必持续观察它们?