Example #1
0
        public void Equals_DateIsNull_DoesNotThrow()
        {
            var c1 = new Contribution("joey", null)
            {
                Comments = "note"
            };
            var c2 = new Contribution("joey", null)
            {
                Comments = "note"
            };

            Assert.IsTrue(c1.Equals(c2));
        }
Example #2
0
        public void Equals_NoteIsNull_DoesNotThrow()
        {
            var now = DateTime.UtcNow;
            var c1  = new Contribution("joey", null)
            {
                Date = now
            };
            var c2 = new Contribution("joey", null)
            {
                Date = now
            };

            Assert.IsTrue(c1.Equals(c2));
        }
Example #3
0
        public void Equals_AllSame_ReturnsTrue()
        {
            var r1 = new Role("dev", "developer", "def");
            var r2 = new Role("dev", "developer", "def");

            var l1 = License.CreativeCommons_Attribution;
            var l2 = License.CreativeCommons_Attribution;

            var d1 = DateTime.Now;

            var c1 = new Contribution("joey", r1)
            {
                Date = d1, Comments = "get bread", ApprovedLicense = l1
            };
            var c2 = new Contribution("joey", r2)
            {
                Date = d1, Comments = "get bread", ApprovedLicense = l2
            };

            Assert.IsTrue(c1.Equals(c2));
        }
Example #4
0
        public void Equals_CompareToObjOfDifferentType_ReturnsFalse()
        {
            var c = new Contribution("joey", null);

            Assert.IsFalse(c.Equals("junk"));
        }
Example #5
0
        public void Equals_CompareToNull_ReturnsFalse()
        {
            var c = new Contribution("joey", null);

            Assert.IsFalse(c.Equals(null));
        }
Example #6
0
        public void Equals_SameInstance_ReturnsTrue()
        {
            var c = new Contribution("joey", null);

            Assert.IsTrue(c.Equals(c));
        }