小编fer*_*ega的帖子

使用IPN Simulator发送Paypal Recurring Payments命令

我正在使用定期付款(Express Checkout),我有一个IPN监听器接收消息.

一切正常,我检查了几个命令,响应和验证.

但我无法使用定期付款测试IPN,因为我在IPN-Simulator的"事务类型"选择器中没有选项:

IPN模拟器

我如何收到Recurring付款IPN命令?

paypal paypal-sandbox paypal-ipn recurring-billing

31
推荐指数
2
解决办法
8818
查看次数

如何从[TestMethod]中控制Console.WriteLine?

我试图从[TestMethod]方法显示一些信息.

通常我们使用NUnit和一行Console.WriteLine运行良好,我们可以在"输出"窗口中看到它,但在这个项目中我们必须使用嵌入VS2010的测试工具并且Console.WriteLine不运行因为我们看不到任何东西.

我想要的是以这种方式或多或少地在"输出"窗口上显示跟踪消息:

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;


namespace Test1
{
    [TestClass]
    public class TestNum1
    {
        [TestMethod]
        public void Constructors()
        {
            for (int b = 1; b < 99; b++) {
                Console.WriteLine(b.ToString());  // <<<<<<< This don't show on Output.
                Assert.AreEqual(b, b);  // This is only a silly sample.
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# testing visual-studio-2010

18
推荐指数
3
解决办法
3万
查看次数

为什么Git配置列表(总计)与system + global + local不同

在Windows上的Git 2.6.3上,为什么这个命令会导致:

git config --list
Run Code Online (Sandbox Code Playgroud)

和其他人不一样:

git config --list --system
git config --list --global
git config --list --local
Run Code Online (Sandbox Code Playgroud)

第一个列出的选项多于其他选项的总和.我已经重定向到文件和kdiff比较,并且存在差异.

根据要求,这是git config --list系统/全局/本地分组中的值而不是:

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files (x86)/Git/mingw32/ssl/certs/ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
Run Code Online (Sandbox Code Playgroud)

上面引用的配置(不在系统/全局/本地)值保存在哪里?

git

16
推荐指数
1
解决办法
2134
查看次数

sqlite LEFT OUTER JOIN多个表

在这个例子中,我们在SQLite数据库上有3个相关的表:

CREATE TABLE test1 (
    c1 integer,
    primary key (c1)
);
CREATE TABLE test2 (
    c1 integer,
    c2 integer,
    primary key (c1, c2)
);    
CREATE TABLE test3 (
    c2 integer,
    c3 integer,
    primary key (c2)
);
Run Code Online (Sandbox Code Playgroud)

现在我需要加入所有表格:

 test1 -> test2 (with c1 column)
          test2 -> test3 (with c2 column).

我试过这个解决方案,但它没有运行:

SELECT 
   * 
   FROM test1 a 
        LEFT OUTER JOIN test2 b
                        LEFT OUTER JOIN test3 c
                          ON c.c2 = b.c2 
          ON b.c1=a.c1 
Run Code Online (Sandbox Code Playgroud)

它给了我一个错误: near "ON": syntax error.

有帮助吗?

sql sqlite outer-join

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

对于异步方法/ Func,无法识别FluentAssertions ShouldNotThrow

我试图检查异步方法抛出具体异常.

为此我使用的是MSTEST和FluentAssertions 2.0.1.

我已经检查了Codeplex上的这个讨论,并看看它如何与异步异常方法一起工作,这是另一个关于FluentAssertions异步测试的链接:

尝试使用我的'生产'代码一段时间之后,我已经关闭了Fluentassertions假的aync类,我的结果代码是这样的(将此代码放在[TestClass]:

[TestMethod]
public void TestThrowFromAsyncMethod()
{
    var asyncObject = new AsyncClass();
    Action action = () =>
    {
        Func<Task> asyncFunction = async () =>
        {
            await asyncObject.ThrowAsync<ArgumentException>();
        };
        asyncFunction.ShouldNotThrow();
    };
}


internal class AsyncClass
{
    public async Task ThrowAsync<TException>()
        where TException : Exception, new()
    {
        await Task.Factory.StartNew(() =>
        {
            throw new TException();
        });
    }

    public async Task SucceedAsync()
    {
        await Task.FromResult(0);
    }
}
Run Code Online (Sandbox Code Playgroud)

问题是ShouldNotThrow无效:

代码无法识别ShouldNotThrow方法.如果我尝试编译,它会给我这个错误:'System.Func'不包含'ShouldNotThrow'的定义和最好的扩展方法重载'FluentAssertions.AssertionExtensions.ShouldNotThrow(System.Action,string,params object []) …

c# async-await fluent-assertions

12
推荐指数
1
解决办法
1万
查看次数

C#通用字典TryGetValue找不到键

我有这个简单的例子:

using System;
using System.Collections.Generic;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Dictionary<MyKey, string> data = new Dictionary<MyKey, string>();
            data.Add(new MyKey("1", "A"), "value 1A");
            data.Add(new MyKey("2", "A"), "value 2A");
            data.Add(new MyKey("1", "Z"), "value 1Z");
            data.Add(new MyKey("3", "A"), "value 3A");

            string myValue;
            if (data.TryGetValue(new MyKey("1", "A"), out myValue))
                Console.WriteLine("I have found it: {0}", myValue );

        }
    }

    public struct MyKey
    {
        private string row;
        private string col;

        public string Row { get { return row; } set …
Run Code Online (Sandbox Code Playgroud)

c# dictionary

11
推荐指数
1
解决办法
9388
查看次数

Delphi:用于填充类上的接口元素的击键或IDE选项

我正在寻找任何IDE菜单选项,击键,shorcut,鼠标点击或其他东西来填充实现它的类中的所有界面元素(方法,属性等).

有什么办法吗?

ide delphi interface delphi-xe

9
推荐指数
2
解决办法
5413
查看次数

Microsoft Message Queue.它被弃用了吗?

我真的从Message Queue开始,我正在寻找非常基本的信息,如何等等.

但我对我所发现的东西有一种奇怪的感觉.似乎"Message Queue Server"不是Visual Studio 2010,Windows 7中的"标准"方式,也不是微软的最新产品,因为我发现的所有信息都与旧的Microsoft产品有关.或者这是我的第一印象.

实际上:http://www.microsoft.com/msmq/ 不运行.它是空的?

总结:我不知道为什么......但我认为来自微软的Message Queue不是一个"前沿"产品,我可能会付出努力,也许还有另一种替代产品.这是真的还是我弄错了?

什么新产品现在提供相同的功能?

谢谢.

msmq visual-studio-2010 windows-7

9
推荐指数
1
解决办法
3585
查看次数

git rm --cached和'deleted'状态

我想知道为什么当我这样做:

git add <file>
Run Code Online (Sandbox Code Playgroud)

然后,我做:

git rm --cached <file>
Run Code Online (Sandbox Code Playgroud)

该文件在阶段área中保持已删除状态.

这里的例子如下: 在此输入图像描述

只是在寻找关于文件中"已删除"状态的说明.

谢谢

git msysgit

8
推荐指数
1
解决办法
6927
查看次数

NUnit 2.6.3 - 未使用消息执行的测试测试适配器发回了未知测试用例的结果

我正在玩NUnit 2.6.3,我做了这个测试:

using NUnit.Framework;
using System;

namespace NUnit26Tests
{
    [TestFixture]
    public class RandomTests
    {
        [Test]
        public void RandomTest([Random(1, 100, 5)] int value)
        {
            Assert.IsTrue(true);
        }

        [Test]
        public void SuccessTests()
        {
            Assert.That(true, Is.True);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但是大多数执行时间(99%)RandomTest都没有在Test Runner上执行.

这是输出消息窗口:

------ Discover test started ------
NUnit 1.0.0.0 discovering tests is started
NUnit 1.0.0.0 discovering test is finished
========== Discover test finished: 6 found (0:00:00,9970583) ==========
------ Run test started ------
NUnit 1.0.0.0 executing tests is started
Run started: C:\TestProjects\NUnit26Tests\NUnit26Tests\bin\Debug\NUnit26Tests.dll
NUnit …

c# nunit visual-studio-2013 nunit-2.6

8
推荐指数
1
解决办法
2776
查看次数