我们最近放弃了我们的自定义测试运行器/发现工具,转而使用py.test.为了在teamcity下运行时进行适当的单元测试报告,存在一个pytest插件:https://github.com/JetBrains/teamcity-python
安装时:
python setup.py安装
pytest正确发现了这个插件.但是,我们不想在我们的构建机器上安装pytest和这个插件.相反,我们宁愿将它们打包为我们的项目"工具"目录的一部分.
如何安装/配置py.test来"发现"这个插件.我们尝试pytest_plugins = "teamcity"在pytest的setup.cfg文件中添加几个变体但没有成功.
在一个非常简单的类上验证映射时,我遇到了一个问题.
System.ApplicationException:对于属性'Created'期望的相同元素,但是获得了具有相同值'8/9/2011 12:07:55 AM'的'System.DateTime'类型的不同元素.提示:在创建PersistenceSpecification对象时使用CustomEqualityComparer.
我已经尝试为equals创建覆盖并获取hashcode方法,这导致了相同的错误.我挖到了持久性规范测试的自定义相等比较器,并再次遇到同样的错误.我或许应该在早上用一双清新的眼睛来看看这个,但我觉得我错过了一些非常基本的东西.
谢谢大家.
public class Blah
{
public int Id { get; set; }
public DateTime Created { get; set; }
public string Description { get; set; }
}
[Test]
public void Can_Correctly_Map_Blah()
{
new PersistenceSpecification<Blah>(Session)
.CheckProperty(c => c.Id, 1)
.CheckProperty(c => c.Description, "Big Description")
.CheckProperty(c => c.Created, System.DateTime.Now)
.VerifyTheMappings();
}
Run Code Online (Sandbox Code Playgroud) 是否有定义的方法将解决方案降级到较低版本的.net Framework.
我正在使用绘图库中的绘图管理器,并出现了一个问题.任何帮助将不胜感激.提前致谢.
问题:创建一个对象(标记,圆圈等)后,我该如何调用它?一个例子是我放置了一个标记.我现在想要附上一个信息窗口.在分配信息窗口的功能中,我需要我刚刚放置的标记的"名称".
如果您需要进一步澄清,请与我们联系.
-Seth
我创建了自定义身份验证.现在我想在注销按钮点击时禁用broswer的缓存.我该怎么办?我应该在注销行动中包含哪些内容?
我关注的是:http://www.bradygaster.com/custom-authentication-with-mvc-3.0
我今天早上一直在和watiN/Nunit一起玩,以捕捉失败的UI测试截图.但是,在访问Nunits TestContext.CurrentContext时,我遇到了NRE的问题......
关于我做错了什么的任何想法?
[TestFixture]
class SomePageTest
{
[Test]
[STAThread]
public void Page_IsAvailable()
{
var browser = new SomePage();
Assert.IsTrue(browser.ContainsText("Something"));
if (TestContext.CurrentContext.Result.Status == TestStatus.Failed)
{
browser.CaptureWebPageToFile(@"X:\location\" + TestContext.CurrentContext.Test.FullName);
}
}
}
public class SomePage: IE
{
public static string SomePageUrl = "http://somepage.com/someurl";
public SomePage() : base(SomePageUrl)
{
}
}
Run Code Online (Sandbox Code Playgroud) 我最近一直在使用流利的nhibernate和更具体的持久性规范测试.
但是,在为此行构建测试模式时,我在运行相对简单的nunit测试时遇到了sql lite错误:(SessionSource.BuildSchema(Session)).
System.Data.SQLite.SQLiteException:"/"附近的SQLite错误:语法错误
寻求一些关于我做错的指导,因为我对流利相对较新.有没有更简单的方法来解决此错误消息?
public class Contact
{
public int Id { get; protected set; }
// some other properties
public IList<Note> Notes { get; set; }
}
public ContactMapping()
{
Not.LazyLoad();
Id(m => m.Id).GeneratedBy.Identity();
HasMany(x => x.Notes).KeyColumns.Add("ContactId");
}
public class Note
{
public int Id { get; protected set; }
public Contact Contact { get; set; }
public string Title { get; set; }
public string Description { get; set; }
}
public NoteMapping()
{
Not.LazyLoad();
Id(m => …Run Code Online (Sandbox Code Playgroud) 我正在尝试将只读文件写入SD卡.我需要将其作为两个步骤来完成.
public void method1(String cacheFilename) {
File cacheDir = mContext.getExternalCacheDir();
File cachedFileOnDisk = new File(cacheDir, cacheFilename);
FileOutputStream fileStream = new FileOutputStream(cachedFile);
fileStream.write(...)
fileStream.flush();
fileStream.close();
}
public void method2(String cacheFilename) {
File cacheDir = mContext.getExternalCacheDir();
File cachedFileOnDisk = new File(cacheDir, cacheFilename);
if(!cachedFileOnDisk.setReadOnly()) {
throw new IllegalStateException();
}
Run Code Online (Sandbox Code Playgroud)
调用method1然后在后续阶段方法2.该cachedFileOnDisk.setReadOnly()调用向我返回false,我无法将该文件设置为只读.
有没有办法可以将只读文件写入SD卡?
举例来说,这是cuda的第一个并行代码。
谁能形容我有关内核调用的信息:<<< N,1 >>>
这是重要的代码:
#define N 10
__global__ void add( int *a, int *b, int *c ) {
int tid = blockIdx.x; // this thread handles the data at its thread id
if (tid < N)
c[tid] = a[tid] + b[tid];
}
int main( void ) {
int a[N], b[N], c[N];
int *dev_a, *dev_b, *dev_c;
// allocate the memory on the GPU
// fill the arrays 'a' and 'b' on the CPU
// copy the arrays …Run Code Online (Sandbox Code Playgroud) 我们的团队早上开始工作,我们发现我们的所有Watin(2.1.0)测试都在我们的集成服务器上失败,但有以下异常.测试也不再适用于本地(IE8或IE9)
WatiN.Core.Exceptions.RunScriptException : RunScript failed
----> System.UnauthorizedAccessException : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Run Code Online (Sandbox Code Playgroud)
请注意,当触发列表框jquery更改事件时,会出现此错误消息:
self.$country.bind('change', function (e) {
var country = $('option:selected', this);
if(country.val() == "??")
{
self.$country.val('US');
}
Run Code Online (Sandbox Code Playgroud)
我们完全失去了:
任何洞察此错误或建议将不胜感激.
c# ×4
asp.net ×2
nunit ×2
watin ×2
android ×1
asp.net-mvc ×1
cuda ×1
foreign-keys ×1
google-maps ×1
nhibernate ×1
pytest ×1
python ×1
teamcity ×1