11using System ;
2- using System . Text ;
32using System . Collections . Generic ;
43using Microsoft . VisualStudio . TestTools . UnitTesting ;
5- using Lithnet . GoogleApps ;
6- using Lithnet . GoogleApps . MA ;
4+ using Microsoft . MetadirectoryServices ;
5+ using System . Linq ;
6+ using System . Net ;
7+ using Google ;
8+ using Google . Apis . Admin . Directory . directory_v1 . Data ;
9+ using Lithnet . GoogleApps . ManagedObjects ;
10+ using Lithnet . MetadirectoryServices ;
711
812namespace Lithnet . GoogleApps . MA . UnitTests
913{
10- using System . Linq ;
11- using System . Net ;
12- using System . Net . Security ;
13- using System . Security . Cryptography . X509Certificates ;
14- using Google ;
15- using Google . Apis . Admin . Directory . directory_v1 . Data ;
16- using Google . GData . Contacts ;
17- using Google . GData . Extensions ;
18- using Lithnet . GoogleApps . MA ;
19- using ManagedObjects ;
20- using MetadirectoryServices ;
21- using Microsoft . MetadirectoryServices ;
22-
2314 [ TestClass ]
2415 public class GroupTests
2516 {
@@ -39,9 +30,11 @@ public void Add()
3930 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "allowWebPosting" , true ) ) ;
4031 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "archiveOnly" , false ) ) ;
4132 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "customReplyTo" , "test@test.com" ) ) ;
33+ cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "customFooterText" , "custom footer" ) ) ;
4234 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "defaultMessageDenyNotificationText" , "occupation" ) ) ;
4335 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "includeInGlobalAddressList" , true ) ) ;
4436 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "isArchived" , false ) ) ;
37+ cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "includeCustomFooter" , true ) ) ;
4538 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "maxMessageBytes" , 5000000 ) ) ;
4639 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "membersCanPostAsTheGroup" , true ) ) ;
4740 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "messageDisplayFont" , "DEFAULT_FONT" ) ) ;
@@ -50,6 +43,7 @@ public void Add()
5043 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "sendMessageDenyNotification" , true ) ) ;
5144 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "showInGroupDirectory" , true ) ) ;
5245 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "spamModerationLevel" , "SILENTLY_MODERATE" ) ) ;
46+ cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanAdd" , "ALL_MANAGERS_CAN_ADD" ) ) ;
5347 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanContactOwner" , "ANYONE_CAN_CONTACT" ) ) ;
5448 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanInvite" , "NONE_CAN_INVITE" ) ) ;
5549 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanJoin" , "CAN_REQUEST_TO_JOIN" ) ) ;
@@ -91,8 +85,10 @@ public void Add()
9185 Assert . AreEqual ( true , s . AllowWebPosting ) ;
9286 Assert . AreEqual ( false , s . ArchiveOnly ) ;
9387 Assert . AreEqual ( "test@test.com" , s . CustomReplyTo ) ;
88+ Assert . AreEqual ( "custom footer" , s . CustomFooterText ) ;
9489 Assert . AreEqual ( "occupation" , s . DefaultMessageDenyNotificationText ) ;
9590 Assert . AreEqual ( true , s . IncludeInGlobalAddressList ) ;
91+ Assert . AreEqual ( true , s . IncludeCustomFooter ) ;
9692 Assert . AreEqual ( false , s . IsArchived ) ;
9793 Assert . AreEqual ( 5000000 , s . MaxMessageBytes ) ;
9894 Assert . AreEqual ( true , s . MembersCanPostAsTheGroup ) ;
@@ -103,6 +99,7 @@ public void Add()
10399 Assert . AreEqual ( true , s . ShowInGroupDirectory ) ;
104100 Assert . AreEqual ( "SILENTLY_MODERATE" , s . SpamModerationLevel ) ;
105101 Assert . AreEqual ( true , s . ShowInGroupDirectory ) ;
102+ Assert . AreEqual ( "ALL_MANAGERS_CAN_ADD" , s . WhoCanAdd ) ;
106103 Assert . AreEqual ( "ANYONE_CAN_CONTACT" , s . WhoCanContactOwner ) ;
107104 Assert . AreEqual ( "NONE_CAN_INVITE" , s . WhoCanInvite ) ;
108105 Assert . AreEqual ( "CAN_REQUEST_TO_JOIN" , s . WhoCanJoin ) ;
@@ -151,9 +148,11 @@ public void Update()
151148 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "allowWebPosting" , true ) ) ;
152149 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "archiveOnly" , false ) ) ;
153150 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "customReplyTo" , "test@test.com" ) ) ;
151+ cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "customFooterText" , "custom footer" ) ) ;
154152 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "defaultMessageDenyNotificationText" , "occupation" ) ) ;
155153 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "includeInGlobalAddressList" , true ) ) ;
156154 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "isArchived" , false ) ) ;
155+ cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "includeCustomFooter" , true ) ) ;
157156 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "maxMessageBytes" , 5000000 ) ) ;
158157 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "membersCanPostAsTheGroup" , true ) ) ;
159158 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "messageDisplayFont" , "DEFAULT_FONT" ) ) ;
@@ -162,6 +161,7 @@ public void Update()
162161 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "sendMessageDenyNotification" , true ) ) ;
163162 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "showInGroupDirectory" , true ) ) ;
164163 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "spamModerationLevel" , "SILENTLY_MODERATE" ) ) ;
164+ cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanAdd" , "ALL_MANAGERS_CAN_ADD" ) ) ;
165165 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanContactOwner" , "ANYONE_CAN_CONTACT" ) ) ;
166166 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanInvite" , "NONE_CAN_INVITE" ) ) ;
167167 cs . AttributeChanges . Add ( AttributeChange . CreateAttributeAdd ( "whoCanJoin" , "CAN_REQUEST_TO_JOIN" ) ) ;
@@ -199,8 +199,10 @@ public void Update()
199199 Assert . AreEqual ( true , s . AllowWebPosting ) ;
200200 Assert . AreEqual ( false , s . ArchiveOnly ) ;
201201 Assert . AreEqual ( "test@test.com" , s . CustomReplyTo ) ;
202+ Assert . AreEqual ( "custom footer" , s . CustomFooterText ) ;
202203 Assert . AreEqual ( "occupation" , s . DefaultMessageDenyNotificationText ) ;
203204 Assert . AreEqual ( true , s . IncludeInGlobalAddressList ) ;
205+ Assert . AreEqual ( true , s . IncludeCustomFooter ) ;
204206 Assert . AreEqual ( false , s . IsArchived ) ;
205207 Assert . AreEqual ( 5000000 , s . MaxMessageBytes ) ;
206208 Assert . AreEqual ( true , s . MembersCanPostAsTheGroup ) ;
@@ -211,6 +213,7 @@ public void Update()
211213 Assert . AreEqual ( true , s . ShowInGroupDirectory ) ;
212214 Assert . AreEqual ( "SILENTLY_MODERATE" , s . SpamModerationLevel ) ;
213215 Assert . AreEqual ( true , s . ShowInGroupDirectory ) ;
216+ Assert . AreEqual ( "ALL_MANAGERS_CAN_ADD" , s . WhoCanAdd ) ;
214217 Assert . AreEqual ( "ANYONE_CAN_CONTACT" , s . WhoCanContactOwner ) ;
215218 Assert . AreEqual ( "NONE_CAN_INVITE" , s . WhoCanInvite ) ;
216219 Assert . AreEqual ( "CAN_REQUEST_TO_JOIN" , s . WhoCanJoin ) ;
@@ -449,29 +452,6 @@ public void RemoveAliases()
449452
450453 }
451454
452- [ TestMethod ]
453- public void test ( )
454- {
455- string id = null ;
456- string dn = $ "{ Guid . NewGuid ( ) } -d1@{ UnitTestControl . TestParameters . Domain } ";
457- Group e = new Group
458- {
459- Email = dn ,
460- Name = Guid . NewGuid ( ) . ToString ( )
461- } ;
462-
463- e = GroupRequestFactory . Add ( e ) ;
464- id = e . Id ;
465-
466- string alias1 = $ "{ Guid . NewGuid ( ) } @{ UnitTestControl . TestParameters . Domain } ";
467- string alias2 = $ "{ Guid . NewGuid ( ) } @{ UnitTestControl . TestParameters . Domain } ";
468- string alias3 = $ "{ Guid . NewGuid ( ) } @{ UnitTestControl . TestParameters . Domain } ";
469-
470- GroupRequestFactory . AddAlias ( id , alias1 ) ;
471- GroupRequestFactory . AddAlias ( id , alias2 ) ;
472-
473- }
474-
475455 [ TestMethod ]
476456 public void AddAlias ( )
477457 {
0 commit comments