コード例 #1
0
        /// <summary>
        ///A test for SetSource
        ///</summary>
        public void SetSourceTestHelper <TProxy, TSource>()
            where TProxy : ISerializableProxy <TSource>, new()
        {
            SerializableProxyList <TProxy, TSource> target = new SerializableProxyList <TProxy, TSource>();
            IList <TSource> source = new List <TSource>();

            target.SetSource(source);
            Assert.AreEqual(source, target.AsSource());
        }
コード例 #2
0
        /// <summary>
        ///A test for AsSource
        ///</summary>
        public void AsSourceTestHelper <TProxy, TSource>()
            where TProxy : ISerializableProxy <TSource>, new()
        {
            SerializableProxyList <TProxy, TSource> target = new SerializableProxyList <TProxy, TSource>();
            IList <TSource> expected = new List <TSource>();

            expected.Add(new TProxy().AsSource());
            IList <TSource> actual;

            target.SetSource(expected);
            actual = target.AsSource();
            CollectionAssert.AreEqual(expected.ToArray(), actual.ToArray());
        }