public void SearchCriteria_EqualsReturnTrueWhenObjectIsComparedToItsOwn() { SearchCriteria simpleSearchCriteria = new SimpleSearchCriteria() { SearchByProgramElementType = true, ProgramElementTypes = new SortedSet<ProgramElementType>() { ProgramElementType.Class, ProgramElementType.Method } }; Assert.True(simpleSearchCriteria.Equals(simpleSearchCriteria), "Equals should return true when search criteria object is compared to its own!"); }
public void SearchCriteria_EqualsReturnFalseWhenObjectsHaveDifferentData() { SearchCriteria simpleSearchCriteria1 = new SimpleSearchCriteria() { SearchByProgramElementType = true, ProgramElementTypes = new SortedSet<ProgramElementType>() { ProgramElementType.Class, ProgramElementType.Property } }; SearchCriteria simpleSearchCriteria2 = new SimpleSearchCriteria() { SearchByProgramElementType = true, ProgramElementTypes = new SortedSet<ProgramElementType>() { ProgramElementType.Class, ProgramElementType.Method } }; Assert.False(simpleSearchCriteria1.Equals(simpleSearchCriteria2), "Equals should return false when search criteria objects have different data!"); }
public void SearchCriteria_EqualsReturnTrueWhenObjectsHaveTheSameData() { SearchCriteria simpleSearchCriteria1 = new SimpleSearchCriteria() { SearchByProgramElementType = true, ProgramElementTypes = new SortedSet<ProgramElementType>() { ProgramElementType.Class, ProgramElementType.Method } }; SearchCriteria simpleSearchCriteria2 = new SimpleSearchCriteria() { SearchByProgramElementType = true, ProgramElementTypes = new SortedSet<ProgramElementType>() { ProgramElementType.Method, ProgramElementType.Class } }; Assert.True(simpleSearchCriteria1.Equals(simpleSearchCriteria2), "Equals should return true when search criteria objects have the same data!"); }