小编Cod*_*nis的帖子

什么是机器人军队测试?

什么是机器人军队测试?在哪里使用?我该怎么学习呢?

testing automated-tests unit-testing robot model-based-testing

6
推荐指数
3
解决办法
447
查看次数

使用ApplicationSettings存储WinForms RadioButtons的Checked属性

我有一个包含3个单选按钮的WinForms对话框.我ApplicationSettings用来绑定每个RadioButton控件的Checked属性,但它没有做我期望它做的事情.现在我必须先点击每个单选按钮两次才能检查它并且所选的单选按钮没有被保留.

当表单关闭以保存用户设置时,是否需要执行一行代码?

如何消除2倍点击单选按钮的需要?

有没有更好的方法来保持这种类型的用户设置?我在对话框类上有一个公共属性,它根据选中的单选按钮获取/设置枚举值,但我没有看到将该属性绑定到用户设置的简单方法.

编辑:应该指定我正在使用vb.net.我认为这意味着My.Settings而不是Properties.Settings.

.net vb.net radio-button winforms

5
推荐指数
3
解决办法
3867
查看次数

"test"服务器中的ASP.NET MVC运行时安装要求

我有一个ASP.NET MVC应用程序,我已经在我的框中本地部署了它.现在,如果我想将它部署在"测试"服务器(这是一个严格控制的环境)中,我需要在测试服务器中至少安装什么 - 即在预安装的ASP.NET 2.0和之上. NET框架.

我需要isntall ASP.NET MVC运行时 - 显然我不会被允许安装任何VS.NET或开发人员特定的MVC的东西.它必须是运行MVC ASP.NET应用程序所需的最小运行时间,仅此而已.

我在哪里获得这样的安装程序?在MS网站的某个地方?

谢谢.

deployment asp.net-mvc

5
推荐指数
1
解决办法
4304
查看次数

如何将我的视图模型中的富文本(FlowDocument?)绑定到RichTextBlock?

我能够在网上找到将文本绑定到WinRT的唯一示例RichTextBlock如下所示:

<RichTextBlock>
    <Paragraph>
        <Run Text="{Binding Content}"/>
    </Paragraph>
</RichTextBlock>
Run Code Online (Sandbox Code Playgroud)

我能够找到实际显示富文本的唯一示例如下所示:

<RichTextBlock>
    <Paragraph>
        <Run>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ligula nisi, vehicula nec eleifend vel, rutrum non dolor. Vestibulum ante ipsum primis in faucibus orci</Run>
        <Run FontSize="30">luctus</Run>
        <Run>et ultrices posuere cubilia Curae; Curabitur elementum scelerisque accumsan. In hac habitasse platea dictumst. Maecenas eu nibh vitae nibh laoreet placerat. Duis dolor ante, semper luctus ullamcorper eget, placerat et ligula. Donec placerat tincidunt vehicula. Fusce condimentum lacus quis libero …
Run Code Online (Sandbox Code Playgroud)

data-binding xaml windows-8 winrt-xaml

5
推荐指数
1
解决办法
3948
查看次数

我如何Json.decode联合类型?

我有一个像这样定义的类型module Foo exposing (..):

type Foo
    = Bar
        { a : String
        , b : String
        }
    | Baz
        ...
Run Code Online (Sandbox Code Playgroud)

然后我试图Json Decoder在一个单独的模块中创建一个解码这样的类型:

barDecoder : Decoder Bar
barDecoder =
    map2 Bar
        (field "a" string)
        (field "b" string)
Run Code Online (Sandbox Code Playgroud)

Elm编译器map2 Bar在行上给出了一个错误,指出Bar找不到类型.包含解码器的模块有import Foo exposing (..).我也尝试将此函数移动到包含类型定义的同一模块中并获得相同的错误,因此它与在单独的模块中没有任何关系.

我已经尝试过将其更改为map2 Foo.Bar,但这也无效.

解码这样的联合类型的正确方法是什么?

json elm

5
推荐指数
2
解决办法
1090
查看次数

NerdDinner示例的Dinner.GetRuleViolations函数如何返回列表?

从我读过的,

yield return <value> 
Run Code Online (Sandbox Code Playgroud)

在执行该行的那一刻跳出函数.然而,Scott Guthrie的文字表明了这一点

var errors = dinner.GetRuleViolations();
Run Code Online (Sandbox Code Playgroud)

成功提取所有规则违规的列表,即使GetRuleViolations是一个很长的列表

if(String.someFunction(text))
    yield return new RuleViolation("Scary message");
if(String.anotherFunction(text))
    yield return new RuleViolation("Another scary message");
Run Code Online (Sandbox Code Playgroud)

这是如何运作的?

c# asp.net-mvc yield-return nerddinner

2
推荐指数
1
解决办法
975
查看次数

如何使用Linq to XML Query搜索节点?

在xml doc下面

    <Root>
        <Global>
        </Global>
        <local>
            <section name="A">
                <subsection name="A">
                    <innersection name="A">
                        <Property1>
                        </Property1>
                    </innersection>
                    <innersection name="B">
                        <Property1>
                        </Property1>
                    </innersection>
                </subsection>
                <subsection name="B">
                    <innersection name="A">
                        <Property1>
                        </Property1>
                    </innersection>
                    <innersection name="B">
                        <Property1>
                        </Property1>
                    </innersection>
                </subsection>
            </section>
            <section name="B">
                <subsection name="A">
                    <innersection name="A">
                        <Property1>
                        </Property1>
                    </innersection>
                    <innersection name="B">
                        <Property1>
                        </Property1>
                    </innersection>
                </subsection>
                <subsection name="B">
                    <innersection name="A">
                        <Property1>
                        </Property1>
                    </innersection>
                    <innersection name="B">
                        <Property1>
                        </Property1>
                    </innersection>
                </subsection>
            </section>
        </local>
    </Root>
Run Code Online (Sandbox Code Playgroud)

现在我想要一个使用linq到xml的单个查询中的section1,其section name ="B"和subsection name ="B"以及innersection name ="B".

.net c# xml vb.net linq-to-xml

2
推荐指数
1
解决办法
1956
查看次数

在VB.NET中使用Rhino Mocks的Expect.Call获取Mock属性

以下C#代码工作正常,测试按预期通过.

using NUnit.Framework;
using Rhino.Mocks;

namespace RhinoMocksTesting
{
    public interface ITesting
    {
        string Test { get; }
    }

    [TestFixture]
    public class MocksTest
    {

        [Test]
        public void TestMockExpect()
        {
            var mocks = new MockRepository();
            var testMock = mocks.StrictMock<ITesting>();
            Expect.Call(testMock.Test).Return("testing");
            mocks.ReplayAll();
            Assert.AreEqual("testing", testMock.Test);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,尝试在VB.NET中做同样的事情甚至不会编译!

Imports NUnit.Framework
Imports Rhino.Mocks

Public Interface ITesting
    ReadOnly Property Test() As String
End Interface

<TestFixture()> _
Public Class MocksTest

    <Test()> _
    Public Sub TestMockExpect()
        Dim mocks = New MockRepository
        Dim testMock = mocks.StrictMock(Of ITesting)()
        Expect.Call(testMock.Test).Return("testing") …
Run Code Online (Sandbox Code Playgroud)

vb.net rhino-mocks visual-studio-2008

2
推荐指数
1
解决办法
2520
查看次数

在VB.NET中找不到HttpContextBase类型(使用带有ASP.NET MVC的Rhino Mocks)

我正在尝试使用Rhino Mocks在VB.NET中实现HtmlHelperTest.cs中的GetHttpContext函数,但是我没有定义"Type'HttpContextBase'." 编译器建议将其更改为,但是当我这样做时,我得到一个运行时错误,密封的类不能被模拟.HttpContext

我的测试项目引用了System.Web并且还导入了该命名空间.还有什么我需要做的才能让HttpContextBase类型对我想要的代码可见吗?

这是代码,但我不知道它与问题有多相关.

Imports NUnit.Framework
Imports Rhino.Mocks
Imports System.Web.Routing

<TestFixture()> _
Public Class XhtmlHelperTest

    Public Const AppPathModifier = "/$(SESSION)"

    'Various test methods here...'

    Private Shared Function GetHttpContext(ByVal appPath As String, _
                                           ByVal requestPath As String, _
                                           ByVal httpMethod As String, _
                                           Optional ByVal protocol As String = "http", _
                                           Optional ByVal port As Integer = -1 _
                                           ) As HttpContextBase
        Dim mockHttpContext = MockRepository.GenerateMock(Of HttpContextBase)()

        If Not String.IsNullOrEmpty(appPath) Then
            mockHttpContext.Expect(Function(hc) hc.Request.ApplicationPath).Return(appPath) …
Run Code Online (Sandbox Code Playgroud)

vb.net asp.net-mvc nunit rhino-mocks

0
推荐指数
1
解决办法
923
查看次数