Ejemplo n.º 1
0
        public void EqualsWithComparerJudgesByTheirBehavior()
        {
            var dir1 = new DirectoryPath("foobar");
            var dir2 = new DirectoryPath("FooBAR");

            Assert.True(dir1.Equals(dir2, FileSystemPathComparer.CaseInsensitive));
            Assert.False(dir1.Equals(dir2, FileSystemPathComparer.CaseSensitive));
        }
Ejemplo n.º 2
0
 public bool Equals(CustomDataDirectoryInfo other)
 {
     //This should be enough to uniquely identify an object.
     return(other != null && Name.Equals(other.Name, StringComparison.OrdinalIgnoreCase) &&
            DirectoryPath.Equals(other.DirectoryPath, StringComparison.OrdinalIgnoreCase) &&
            (other.Guid == Guid || (!other.HasManifest && !HasManifest)) && other.MyVersion.Equals(MyVersion) &&
            other.DependenciesList.CollectionEqual(DependenciesList) &&
            other.IncompatibilitiesList.CollectionEqual(IncompatibilitiesList));
 }