Exemple #1
0
        public void An_instance_of_a_type_derived_from_ObjectId_is_equal_to_a_primitive_of_its_underlying_value()
        {
            var i        = Any.Int();
            var objectId = new ObjectIdOfInt(i);

            (objectId == i).Should().BeTrue();
            // (i == objectId).Should().BeTrue();
            (objectId.Equals(i)).Should().BeTrue();
            // (i.Equals(objectId)).Should().BeTrue();
            (Equals(objectId, i)).Should().BeTrue();
        }
Exemple #2
0
        public void Two_instances_of_type_derived_from_ObjectId_having_the_same_underlying_value_are_equal()
        {
            var id  = Any.Int();
            var id1 = new ObjectIdOfInt(id);
            var id2 = new ObjectIdOfInt(id);

            (id1 == id2).Should().BeTrue();
            (id2 == id1).Should().BeTrue();
            (id1.Equals(id2)).Should().BeTrue();
            (id2.Equals(id1)).Should().BeTrue();
            (Equals(id1, id2)).Should().BeTrue();
        }