예제 #1
0
        public void Restore_returnsExpected()
        {
            var add1 = "add1";

            var add3 = "ADD3";
            var add6 = "address 6";

            var expected = new AddressLines(add1, null, add3, null, null, add6);

            var sut = new AddressNameNumber(expected);

            sut.Simplify();
            sut.Address6 = "new address 6";

            sut.Restore();

            Assert.That(sut, Is.Not.Null);

            Assert.That(sut.FullAddress(), Is.EqualTo(expected.FullAddress()));
            Assert.That(sut.Address1, Is.EqualTo(add1));
            Assert.That(sut.Address2, Is.Null);
            Assert.That(sut.Address3, Is.EqualTo(add3));
            Assert.That(sut.Address4, Is.Null);
            Assert.That(sut.Address5, Is.Null);
            Assert.That(sut.Address6, Is.EqualTo(add6));
        }
예제 #2
0
        public void RestoreEmpty_returnsExpected()
        {
            var expected = new AddressLines(null, null, null, null, null, null);

            var sut = new AddressNameNumber(expected);

            sut.Simplify();
            sut.Address6 = "new address 6";

            sut.Restore();

            Assert.That(sut, Is.Not.Null);

            Assert.That(sut.FullAddress(), Is.EqualTo(expected.FullAddress()));
            Assert.That(sut.Address1, Is.Null);
            Assert.That(sut.Address2, Is.Null);
            Assert.That(sut.Address3, Is.Null);
            Assert.That(sut.Address4, Is.Null);
            Assert.That(sut.Address5, Is.Null);
            Assert.That(sut.Address6, Is.Null);
        }