这是我的场景,我想进行数据驱动的单元测试,并且与环境无关我想在我的程序集中嵌入数据文件.我怎样才能在单元测试的DataSourceAttribute中引用呢?
我正在尝试使用Microsoft Jet OleDB提供程序访问Excel 2003文件.当文件在硬盘驱动器中时,单元测试工作正常,但在我尝试访问嵌入式组装文件时则不行.这是我的例子:
原版的
[DeploymentItem("IHRM.Infrastructure.EFRepositories.Tests\DataDriven.xls"),DataSource("System.Data.OleDb","Provider = Microsoft.Jet.OLEDB.4.0; Data Source = | DataDirectory |\DataDriven.xls;扩展属性= \"Excel 8.0 \"","Sheet1 $",DataAccessMethod.Sequential),TestMethod]
建议
[DataSource("System.Data.OleDb","Provider = Microsoft.Jet.OLEDB.4.0; Data Source = "这里放什么" ;扩展属性= \"Excel 8.0 \"","Sheet1 $",DataAccessMethod. Sequential),DeploymentItem("IHRM.Infrastructure.EFRepositories.Tests\DataDriven.xls"),TestMethod]
我正在尝试反序列化以下XML输出:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Foo>
<Val>Data1</Val>
</Foo>
<Foo>
<Val>Data2</Val>
</Foo>
Run Code Online (Sandbox Code Playgroud)
(这是从硬件设备输出,不能更改)
我有一个XML类型定义为:
[XmlType(AnonymousType=true, Namespace="")]
public class Foo
{
public string Val { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我试图通过创建一个序列化器来反序列化这个数组:
var s = new XmlSerializer(typeof(Foo[]));
//or
var s = new XmlSerializer(typeof(List<Foo>);
Run Code Online (Sandbox Code Playgroud)
但每次调用s.Deserialize()都会导致InvalidOperaitonException:
System.InvalidOperationException: <Foo xmlns=''> was not expected.
Run Code Online (Sandbox Code Playgroud)
注意
var s = new XmlSerializer(typeof(Foo));
// Only deseralizes the first Foo (Data1).
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助.
Silverligh 4,VS 2010.
进行自定义控制.(不仅仅是UserControl,而是公共类HandPart:Control,以及\ themes中的模板)
然后我用一个帮助器片段创建一个新的DependencyProperty:
#region SomeDouble (DependencyProperty)
/// <summary>
/// A description of the property.
/// </summary>
public Double SomeDouble
{
get { return (Double)GetValue(SomeDoubleProperty); }
set { SetValue(SomeDoubleProperty, value); }
}
public static readonly DependencyProperty SomeDoubleProperty =
DependencyProperty.Register("SomeDouble", typeof(Double), typeof(HandPart),
new PropertyMetadata(0));
#endregion
Run Code Online (Sandbox Code Playgroud)
因此,解决方案是编译没有任何错误和消息,但它没有启动.当我创建DependencyProperty时,例如,Int类型insted Double或Single,它工作正常.
浮动有什么问题,(功能?)?为什么我不能用浮点类型创建DP?
我似乎无法使用eclim运行简单的Hello World程序.我跟着在安装指南http://eclim.org/guides/install.html#guides-install和教程在http://eclim.org/gettingstarted.html#gettingstarted,但是当我尝试运行程序(使用:Java)我明白了
java.lang.RuntimeException: Required setting 'org.eclim.java.run.mainclass' has not been set.
at org.eclim.plugin.jdt.command.src.JavaCommand.execute(JavaCommand.java:107)
at org.eclim.command.Main.main(Main.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:334)
Run Code Online (Sandbox Code Playgroud)
而且我不知道如何设置它没有设置的任何内容.程序成功编译,我可以在终端中定期运行,我使用的是Ubuntu 9.10,java jdk 1.6,eclim 1.5.4.
(nodeA@foo.hyd.com)8> spawn(nodeA@bar.del.com, tut, test, [hello, 5]).
Run Code Online (Sandbox Code Playgroud)
我想在 bar.del.com 上生成一个进程,该进程没有对 foo.hyd.com 的文件系统访问权限(从我生成进程的位置),运行模块“tut”的子例程“test”。
有没有办法做到这一点,而无需为 nodeA@bar.del.com 提供已编译的“tut”模块文件?
在我的项目中,用户将上传图像,项目徽标将附加(嵌入)到图像的底部。
是否可以实施?
如果是的话如何实施?
请帮忙。
下面的代码将不会加入,在调试时,命令不会存储整个路径,只会存储最后一个条目.
os.path.join('/home/build/test/sandboxes/', todaystr, '/new_sandbox/')
Run Code Online (Sandbox Code Playgroud)
当我测试它时,它只存储/new_sandbox/代码的一部分.
在我的项目中,我有一个注册表.
我的HTML看起来像
<form method="post" action="/users">
<div style="margin: 0pt; padding: 0pt;">
<input type="hidden" value="lDHrKRC2ENhRKcaoBR4XGfzri/MY09PjqVDvHRtC0D4=" name="authenticity_token"/>
</div>
<p><label for="login">Login</label>
<input type="text" size="30" name="user[login]" id="user_login"/></p>
<p><label for="email">Email</label>
<input type="text" size="30" name="user[email]" id="user_email"/></p>
<p><label for="password">Password</label>
<input type="password" size="30" name="user[password]" id="user_password"/></p>
<p><label for="password_confirmation">Confirm Password</label>
<input type="password" size="30" name="user[password_confirmation]" id="user_password_confirmation"/></p>
<p><input type="submit" value="Sign up" name="commit"/></p>
</form>
Run Code Online (Sandbox Code Playgroud)
现在通过提交空表单生成错误我的代码如下:
<form method="post" action="/users">
<div style="margin: 0pt; padding: 0pt;"><input type="hidden" value="lDHrKRC2ENhRKcaoBR4XGfzri/MY09PjqVDvHRtC0D4=" name="authenticity_token"/>
</div>
<p><label for="login">Login</label>
</p><div class="fieldWithErrors"><input type="text" value="hg" size="30" name="user[login]" id="user_login"/></div>
<p><label for="email">Email</label>
</p><div class="fieldWithErrors"><input type="text" value="gh" size="30" name="user[email]" …Run Code Online (Sandbox Code Playgroud) SQL Server Management Studio Object Explorer菜单消失了.快捷方式F8和view->object explorer方法都没有做任何事情.我点击了键盘上的所有内容,用Google搜索,但没有任何内容.
我真的需要这个,这是一个巨大的麻烦,必须在没有对象资源管理器树视图的情况下浏览摘要窗口!
.net ×2
c# ×2
.net-2.0 ×1
c++ ×1
distributed ×1
eclim ×1
eclipse ×1
erlang ×1
header-files ×1
java ×1
mstest ×1
path ×1
python ×1
silverlight ×1
spawn ×1
sql-server ×1
ssms ×1
unit-testing ×1
vim ×1
xmlroot ×1