How to Compare two objects in unit test?

前端 未结 15 1710
自闭症患者
自闭症患者 2020-11-30 03:15
public class Student
{
    public string Name { get; set; }
    public int ID { get; set; }
}

...

var st1 = new Student
{
    ID =          


        
15条回答
  •  生来不讨喜
    2020-11-30 03:25

    Have a look at the following link. Its a solution on code project and I have used it too. It works fine for comparing the objects in both NUnit and MSUnit

    http://www.codeproject.com/Articles/22709/Testing-Equality-of-Two-Objects?msg=5189539#xx5189539xx

提交回复
热议问题