Пример #1
0
		public void CloneDerived()
		{
			ClonableDerived d = new ClonableDerived { Count = 3, Name = "Test" };
			ClonableDerived d2 = d.Clone();
			Assert.That(d2, Is.Not.SameAs(d));
			Assert.That(d2.Count, Is.EqualTo(d.Count));
			Assert.That(d2.Name, Is.EqualTo(d.Name));
		}
Пример #2
0
		public void CloneDerivedAsBase()
		{
			ClonableBase b = new ClonableDerived { Count = 3, Name = "Test" };
			ClonableBase b2 = b.Clone();
			Assert.That(b2, Is.Not.SameAs(b));
			Assert.That(b2.Count, Is.EqualTo(b.Count));
			Assert.That(b2, Is.TypeOf<ClonableDerived>());
			Assert.That(((ClonableDerived) b2).Name, Is.EqualTo(((ClonableDerived) b).Name));
		}
Пример #3
0
        public void CloneDerived()
        {
            ClonableDerived d = new ClonableDerived {
                Count = 3, Name = "Test"
            };
            ClonableDerived d2 = d.Clone();

            Assert.That(d2, Is.Not.SameAs(d));
            Assert.That(d2.Count, Is.EqualTo(d.Count));
            Assert.That(d2.Name, Is.EqualTo(d.Name));
        }
Пример #4
0
        public void CloneDerivedAsBase()
        {
            ClonableBase b = new ClonableDerived {
                Count = 3, Name = "Test"
            };
            ClonableBase b2 = b.Clone();

            Assert.That(b2, Is.Not.SameAs(b));
            Assert.That(b2.Count, Is.EqualTo(b.Count));
            Assert.That(b2, Is.TypeOf <ClonableDerived>());
            Assert.That(((ClonableDerived)b2).Name, Is.EqualTo(((ClonableDerived)b).Name));
        }
Пример #5
0
 protected ClonableDerived(ClonableDerived other)
     : base(other)
 {
     Name = other.Name;
 }
Пример #6
0
		protected ClonableDerived(ClonableDerived other)
			: base(other)
		{
			Name = other.Name;
		}