【问题标题】:subsonic unit testing bug?亚音速单元测试错误?
【发布时间】:2009-08-05 10:35:28
【问题描述】:

我目前正在使用 Subsonic 3.03 Active Record 存储库。

我已经设置了一个 Test 连接字符串来利用虚拟内部存储。

    [TestInitialize]
    public void TestInitialize()
    {
        List<ServiceJob> jobs = new List<ServiceJob>()
        {
            new ServiceJob() { ServiceJobID = 1 },
            new ServiceJob() { ServiceJobID = 2 }
        };

        ServiceJob.Setup(jobs);
    }

    [TestMethod]
    public void TestMethod()
    {
        ServiceJob job = ServiceJob.SingleOrDefault(s => s.ServiceJobID == 2);
        Assert.AreEqual(2, job.ServiceJobID);
    }

我希望这个单元测试能够通过,但它退出了第一个服务作业并失败了。 我在使用 .Find() 等其他糖类方法时也遇到过问题。

在使用 IQueryable 接口(例如 ServiceJob.All.Where(s => s.ServiceJobID == 2) 时它可以正常工作,但不要为了测试目的而剥离糖!

顺便说一句,很棒的产品,到目前为止真的给我留下了深刻的印象。

【问题讨论】:

标签: subsonic subsonic3


【解决方案1】:

正如你所说,这看起来绝对是一个错误。您应该将其作为问题提交给 github:

http://github.com/subsonic/SubSonic-3.0/issues

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-28
    • 2010-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多