Exemple #1
0
        private void RunPrototypeTest()
        {
            Prototype prototype = new ConcretePrototypeA(1);
            Prototype clone     = prototype.Clone();

            Console.WriteLine("itemA_id={0}", clone.Id);

            prototype = new ConcretePrototypeB(2);
            clone     = prototype.Clone();
            Console.WriteLine("itemB_id={0}", clone.Id);
        }
        public void Prototype_CheckClone()
        {
            var concreteB = new ConcretePrototypeB()
            {
                Name = "A"
            };

            var concreteA = concreteB.Clone();

            Assert.IsTrue(concreteA.Name == concreteB.Name);
        }