public void BeVirtualProperty() { var userBook = new UserBook(); var isVirtual = userBook.GetType() .GetProperty("Book") .GetAccessors()[0].IsVirtual; Assert.IsTrue(isVirtual); }
public void HaveColumnAttributeWithOrderOne() { var userBook = new UserBook(); var attr = userBook.GetType() .GetProperty("BookId") .GetCustomAttributes(typeof(ColumnAttribute), false)[0] as ColumnAttribute; Assert.AreEqual(1, attr.Order); }
public void HaveColumnAttribute() { var userBook = new UserBook(); var hasAttr = userBook.GetType() .GetProperty("BookId") .GetCustomAttributes(typeof(ColumnAttribute), false) .Any(); Assert.IsTrue(hasAttr); }