Beispiel #1
0
        public void New_Deserializes_Valid_HumanAddress_Json()
        {
            string json = String.Format(@"{{""address"":""{0}"",""city"":""{1}"",""state"":""{2}"",""zip"":""{3}""}}", address, city, state, zip);

            HumanAddress humanAddress = new HumanAddress(json);

            Assert.AreEqual(address, humanAddress.Address);
            Assert.AreEqual(city, humanAddress.City);
            Assert.AreEqual(state, humanAddress.State);
            Assert.AreEqual(zip, humanAddress.Zip);
        }
Beispiel #2
0
        public void New_Deserializes_Valid_HumanAddress_Json()
        {
            string json = String.Format(@"{{""address"":""{0}"",""city"":""{1}"",""state"":""{2}"",""zip"":""{3}""}}", address, city, state, zip);

            HumanAddress humanAddress = new HumanAddress(json);

            Assert.AreEqual(address, humanAddress.Address);
            Assert.AreEqual(city, humanAddress.City);
            Assert.AreEqual(state, humanAddress.State);
            Assert.AreEqual(zip, humanAddress.Zip);
        }
Beispiel #3
0
        public void HumanAddresses_With_Different_Data_Are_Not_Equal()
        {
            var humanAddress1 = new HumanAddress() {
                Address = address,
                City = city,
                State = state,
                Zip = zip
            };

            var humanAddress2 = new HumanAddress() {
                Address = address + "different",
                City = city + "different",
                State = state + "different",
                Zip = zip + "different"
            };

            Assert.AreNotEqual(humanAddress1, humanAddress2);
        }
Beispiel #4
0
        public void HumanAddresses_With_Different_Data_Are_Not_Equal()
        {
            var humanAddress1 = new HumanAddress()
            {
                Address = address,
                City    = city,
                State   = state,
                Zip     = zip
            };

            var humanAddress2 = new HumanAddress()
            {
                Address = address + "different",
                City    = city + "different",
                State   = state + "different",
                Zip     = zip + "different"
            };

            Assert.AreNotEqual(humanAddress1, humanAddress2);
        }
Beispiel #5
0
        public void HumanAddresses_With_Same_Data_Are_Equal()
        {
            var humanAddress1 = new HumanAddress() {
                Address = address,
                City = city,
                State = state,
                Zip = zip
            };

            var humanAddress2 = new HumanAddress() {
                Address = address,
                City = city,
                State = state,
                Zip = zip
            };

            //they are different objects
            Assert.False(Object.ReferenceEquals(humanAddress1, humanAddress2));

            //but they are equal
            Assert.AreEqual(humanAddress1, humanAddress2);
        }
Beispiel #6
0
        public void HumanAddresses_With_Same_Data_Are_Equal()
        {
            var humanAddress1 = new HumanAddress()
            {
                Address = address,
                City    = city,
                State   = state,
                Zip     = zip
            };

            var humanAddress2 = new HumanAddress()
            {
                Address = address,
                City    = city,
                State   = state,
                Zip     = zip
            };

            //they are different objects
            Assert.False(Object.ReferenceEquals(humanAddress1, humanAddress2));

            //but they are equal
            Assert.AreEqual(humanAddress1, humanAddress2);
        }