Beispiel #1
0
        public void CloneTest()
        {
            var author = new Author
            {
                Id = 5,
                FirstName = "Jeff",
                LastName = "Richter"
            };

            var result = (Author)author.Clone();

            Assert.AreEqual(author.Id, result.Id);
            Assert.AreEqual(author.FirstName, result.FirstName);
            Assert.AreEqual(author.LastName, result.LastName);
        }
Beispiel #2
0
 private static Author Copy(Author author)
 {
     return author != null ? (Author) author.Clone() : null;
 }