예제 #1
0
        public void DefaultValues()
        {
            var sut = new Proposal();

            Assert.Null(sut.Name);
            Assert.False(sut.Relevance.HasValue);
            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
예제 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(Bug.GetHashCode() ^ Enhancement.GetHashCode() ^ Proposal.GetHashCode() ^ Task.GetHashCode());
     }
 }
예제 #3
0
        public void Equality_Default()
        {
            var a = new Proposal();
            var b = new Proposal();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #4
0
        public void Equality_DifferentRelevanceWithZero()
        {
            var a = new Proposal {
                Relevance = 0
            };
            var b = new Proposal();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #5
0
        public void Equality_DifferentName()
        {
            var a = new Proposal
            {
                Name = Names.General("a")
            };
            var b = new Proposal();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #6
0
        public void Equality_ReallyTheSame()
        {
            var a = new Proposal
            {
                Name      = Names.General("a"),
                Relevance = 3
            };
            var b = new Proposal
            {
                Name      = Names.General("a"),
                Relevance = 3
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #7
0
 public override int GetHashCode()
 {
     return(string.IsNullOrEmpty(_result) ? GetType().GetHashCode() : _result.GetHashCode() ^ Proposal.GetHashCode());
 }