views:

56

answers:

1

EDIT: 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);
    }

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???

A: 

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

Adam
OK - will do that