@@ -48,6 +48,64 @@ public TopicRepositoryBaseTest() {
4848 _topicRepository = new StubTopicRepository ( ) ;
4949 }
5050
51+ /*==========================================================================================================================
52+ | TEST: GET ATTRIBUTES: ANY ATTRIBUTES: RETURNS ALL ATTRIBUTES
53+ \-------------------------------------------------------------------------------------------------------------------------*/
54+ /// <summary>
55+ /// Retrieves a list of attributes from a topic, without any filtering by whether or not the attribute is an <see
56+ /// cref="AttributeDescriptor.IsExtendedAttribute"/>.
57+ /// </summary>
58+ [ TestMethod ]
59+ public void GetAttributes_AnyAttributes_ReturnsAllAttributes ( ) {
60+
61+ var topic = TopicFactory . Create ( "Test" , "ContentTypes" ) ;
62+
63+ topic . Attributes . SetValue ( "Title" , "Title" ) ;
64+
65+ var attributes = _topicRepository . GetAttributesProxy ( topic , null ) ;
66+
67+ Assert . AreEqual < int > ( 3 , attributes . Count ( ) ) ;
68+
69+ }
70+
71+ /*==========================================================================================================================
72+ | TEST: GET ATTRIBUTES: INDEXED ATTRIBUTES: RETURNS INDEXED ATTRIBUTES
73+ \-------------------------------------------------------------------------------------------------------------------------*/
74+ /// <summary>
75+ /// Retrieves a list of attributes from a topic, filtering by <see cref="AttributeDescriptor.IsExtendedAttribute"/>.
76+ /// </summary>
77+ [ TestMethod ]
78+ public void GetAttributes_IndexedAttributes_ReturnsIndexedAttributes ( ) {
79+
80+ var topic = TopicFactory . Create ( "Test" , "ContentTypes" ) ;
81+
82+ topic . Attributes . SetValue ( "Title" , "Title" ) ;
83+
84+ var attributes = _topicRepository . GetAttributesProxy ( topic , false ) ;
85+
86+ Assert . AreEqual < int > ( 2 , attributes . Count ( ) ) ;
87+
88+ }
89+
90+ /*==========================================================================================================================
91+ | TEST: GET ATTRIBUTES: EXTENDED ATTRIBUTES: RETURNS EXTENDED ATTRIBUTES
92+ \-------------------------------------------------------------------------------------------------------------------------*/
93+ /// <summary>
94+ /// Retrieves a list of attributes from a topic, filtering by <see cref="AttributeDescriptor.IsExtendedAttribute"/>.
95+ /// </summary>
96+ [ TestMethod ]
97+ public void GetAttributes_ExtendedAttributes_ReturnsExtendedAttributes ( ) {
98+
99+ var topic = TopicFactory . Create ( "Test" , "ContentTypes" ) ;
100+
101+ topic . Attributes . SetValue ( "Title" , "Title" ) ;
102+
103+ var attributes = _topicRepository . GetAttributesProxy ( topic , true ) ;
104+
105+ Assert . AreEqual < int > ( 1 , attributes . Count ( ) ) ;
106+
107+ }
108+
51109 /*==========================================================================================================================
52110 | TEST: GET CONTENT TYPE DESCRIPTORS: RETURNS CONTENT TYPES
53111 \-------------------------------------------------------------------------------------------------------------------------*/
0 commit comments