public void CompareDifferentPeopleOfTheSameSize_ReturnsExpectedResult() { //Arrange var rightPerson = new Person() { Name = "Rafa", Age = 18, City = "Denver", Profession = "Dev" }; var leftPerson = new Person() { Name = "Rafa", Age = 28, City = "Berlin", Profession = "Dev" }; var expectedDifferences = new List <string>() { "age", "city" }; var expectedResult = new DiffResult() { AreEqual = false, AreSameSize = true, Differences = expectedDifferences }; //Act var actualResult = PeopleComparerHelper.Compare(rightPerson, leftPerson); //Assert Assert.AreEqual(expectedResult, actualResult); }
public void CompareNullPeople_ReturnsNull() { //Act var actualResult = PeopleComparerHelper.Compare(null, null); //Assert Assert.IsNull(actualResult); }
public void CompareWithNull_ReturnsNull() { //Arrange var rightPerson = new Person() { Name = "Rafa", Age = 18, City = "Denver", Profession = "Dev" }; //Act var actualResult = PeopleComparerHelper.Compare(rightPerson, null); //Assert Assert.IsNull(actualResult); }
public void ComparePeopleWithDifferentSizes_ReturnsExpectedResult() { //Arrange var rightPerson = new Person() { Name = "Rafa", City = "Berlin", Profession = "Dev" }; var leftPerson = new Person() { Name = "Rafa", Age = 28, City = "Berlin", Profession = "Dev" }; var expectedResult = new DiffResult() { AreEqual = false, AreSameSize = false }; //Act var actualResult = PeopleComparerHelper.Compare(rightPerson, leftPerson); //Assert Assert.AreEqual(expectedResult, actualResult); }