public static void B_GetAttributeOnObject() { var googlePage = new GooglePage(); IEnumerable <PageUrlAttribute> pageUrlAttribute = googlePage.GetType().GetCustomAttributes <PageUrlAttribute>(); pageUrlAttribute .Should() .HaveCount(1); }