示例#1
0
        public void ExistingListsValuesArePersistedOnListsThatAreProperties()
        {
            var mapper = new MemberMapper();

            var list = new List <int> {
                1, 2, 3, 4, 5
            };

            var array = new[] { 6, 7, 8, 9, 0 };

            var source = new SourceArrayPropertyClass
            {
                Foo = array
            };

            var destination = new DestinationListPropertyClass
            {
                Foo = list
            };

            mapper.Map(source, destination);

            Assert.IsTrue(list.Contains(9));
            Assert.AreEqual(10, list.Count);
        }
示例#2
0
        public void ExistingListsValuesArePersistedOnListsThatAreProperties()
        {
            var mapper = new MemberMapper();

              var list = new List<int> { 1, 2, 3, 4, 5 };

              var array = new[] { 6, 7, 8, 9, 0 };

              var source = new SourceArrayPropertyClass
              {
            Foo = array
              };

              var destination = new DestinationListPropertyClass
              {
            Foo = list
              };

              mapper.Map(source, destination);

              Assert.IsTrue(list.Contains(9));
              Assert.AreEqual(10, list.Count);
        }