Beispiel #1
0
        public void CanCompareInstances()
        {
            var glob = new Glob("abc", FileSystem);

            Assert.False(glob.Equals(4711));
            Assert.True(glob.Equals(new Glob("abc")));
        }
Beispiel #2
0
        public void CanCompareInstances()
        {
            var glob = new Glob(FileSystem)
            {
                Pattern = "abc"
            };

            Assert.False(glob.Equals(4711));
            Assert.True(glob.Equals(new Glob()
            {
                Pattern = "abc"
            }));
        }
Beispiel #3
0
        public void Can_determine_equality()
        {
            var  s = "a";
            var  a = new Glob("a");
            var  b = new Glob("b");
            var  c = new Glob("a");
            Glob n = null;

            (s == a).ShouldBeTrue();
            (a == c).ShouldBeTrue();
            (a != b).ShouldBeTrue();
            (a == b).ShouldBeFalse();
            (n == null).ShouldBeTrue();
            a.Equals(b).ShouldBeFalse();
            a.Equals("a").ShouldBeTrue();
            (a == null).ShouldBeFalse();
            a.GetHashCode().ShouldBe(c.GetHashCode());
        }
Beispiel #4
0
 public bool Equals(FileMetadataItem other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Glob.Equals(other.Glob) && Comparer.Equals(Key, other.Key) && Comparer.Equals(Value.ToJsonString(), other.Value.ToJsonString()));
 }