Subsonic 3.0 测试 - 我在这里遗漏了什么? [英] Subsonic 3.0 testing - what am I missing here?

查看:29
本文介绍了Subsonic 3.0 测试 - 我在这里遗漏了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题已在 Github 上提交.把Act"部分改成这样,测试就通过了

This issue is already submitted on Github. Changing the "Act" part to this will make the test pass

        var result = Adresse.All()
                .Where(x => x.AdresseX == txt1 && x.PostBy == txt2)
                .FirstOrDefault();

<小时>

    [TestMethod]
    public void WTF()
    {
        //Arrange
        string txt1 = "Vingsted Skovvej 1";
        string txt2 = "7100 Vejle";

        var one = new Adresse { ID = 1, AdresseX = "Vejlevej 55", PostBy = "7300" };
        var two = new Adresse {ID = 2, AdresseX = txt1, PostBy = txt2 };
        Adresse.Setup(new List<Adresse> { one, two });

        //Act
        var result = Adresse.SingleOrDefault(x => x.AdresseX == txt1 && x.PostBy == txt2);            

        //Assert
        Assert.AreEqual(2, result.ID);
    }

以下测试失败了,因为我取回了第一个对象(ID 等于 1 的对象)......有人可以向我解释我做错了什么吗???

The following test fails me because I get the first object back (the one where ID equals 1)... Can somebody explain to me what I'm doing wrong???

推荐答案

这在 github,不过你可以添加任何信息.

This is logged as an issue on github, it would be worth you adding any info you can to it though.

这篇关于Subsonic 3.0 测试 - 我在这里遗漏了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆