Esempio n. 1
0
        public void GetHashCodeWorksCorrectly()
        {
            var path = new FileSystemPath("Hello");

            path.GetHashCode().Should().Be(path.GetHashCode());

            Func <string, int> hash = s => new FileSystemPath(s).GetHashCode();

            hash("Hello").Should().Be(hash("Hello"));
            hash("Hello").Should().Be(hash("HELLO"));
            hash("Hello").Should().NotBe(hash("Hello "));
        }
Esempio n. 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Range.GetHashCode();
         hashCode = (hashCode * 397) ^ FileSystemPath.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)ProgramType;
         return(hashCode);
     }
 }
Esempio n. 3
0
        public void GetHashCodeWorksCorrectly()
        {
            var path = new FileSystemPath("Hello");
            path.GetHashCode().Should().Be(path.GetHashCode());

            Func<string, int> hash = s => new FileSystemPath(s).GetHashCode();

            hash("Hello").Should().Be(hash("Hello"));
            hash("Hello").Should().Be(hash("HELLO"));
            hash("Hello").Should().NotBe(hash("Hello "));
        }