Exemple #1
0
        public void ValueTupleValuedExample()
        {
            Address address1 = Address.From(("16 Food Street", "London", Postcode.From("N1 1LT")));
            Address address2 = Address.From(("16 Food Street", "London", Postcode.From("N1 1LT")));

            Assert.AreEqual(address1, address2);
            Assert.AreEqual(address1.GetHashCode(), address2.GetHashCode());

            Address address3 = Address.From(("17 Food Street", "London", Postcode.From("N1 1LT")));

            Assert.AreNotEqual(address1, address3);
            Assert.AreNotEqual(address1.GetHashCode(), address3.GetHashCode());
        }
Exemple #2
0
        public void ToStringReturnsValueOfTupleForTupleValuedObjects()
        {
            Address address1 = Address.From(("16 Food Street", "London", Postcode.From("N1 1LT")));

            Assert.AreEqual(address1.Value.ToString(), address1.ToString());
        }