Skip to content

Commit 37ea10a

Browse files
committed
Adds support for new group settings attributes reported in issue #3
Updates google api packages, and fixes compatibility issues with the new builds
1 parent 03c1240 commit 37ea10a

File tree

13 files changed

+165
-123
lines changed

13 files changed

+165
-123
lines changed

src/Lithnet.GoogleApps.MA.Setup/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Product Id="*"
44
Name="Lithnet GoogleApps Management Agent"
55
Language="1033"
6-
Version="1.1.6049"
6+
Version="1.1.6086"
77
Manufacturer="Lithnet"
88
UpgradeCode="3410d571b358426281edb2990ae57cae" >
99

src/Lithnet.GoogleApps.MA.UnitTests/AdvancedUserTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ public void Update()
262262
Department = "test",
263263
Symbol = "test",
264264
Location = "test",
265+
Type = "work"
265266
});
266267

267268
e.Phones = new List<Phone>();

src/Lithnet.GoogleApps.MA.UnitTests/GroupTests.cs

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
using System;
2-
using System.Text;
32
using System.Collections.Generic;
43
using 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

812
namespace 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
{

src/Lithnet.GoogleApps.MA.UnitTests/Lithnet.GoogleApps.MA.UnitTests.csproj

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,36 @@
3737
<WarningLevel>4</WarningLevel>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
41-
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
40+
<Reference Include="BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
41+
<HintPath>..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
4242
<Private>True</Private>
4343
</Reference>
44-
<Reference Include="Google.Apis, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
45-
<HintPath>..\packages\Google.Apis.1.11.1\lib\net45\Google.Apis.dll</HintPath>
44+
<Reference Include="Google.Apis, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
45+
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
4646
<Private>True</Private>
4747
</Reference>
48-
<Reference Include="Google.Apis.Admin.Directory.directory_v1, Version=1.12.0.447, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
49-
<HintPath>..\packages\Google.Apis.Admin.Directory.directory_v1.1.12.0.447\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.Admin.Directory.directory_v1.dll</HintPath>
48+
<Reference Include="Google.Apis.Admin.Directory.directory_v1, Version=1.16.0.601, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
49+
<HintPath>..\packages\Google.Apis.Admin.Directory.directory_v1.1.16.0.601\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.Admin.Directory.directory_v1.dll</HintPath>
5050
<Private>True</Private>
5151
</Reference>
52-
<Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
53-
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
52+
<Reference Include="Google.Apis.Auth, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
53+
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
5454
<Private>True</Private>
5555
</Reference>
56-
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
57-
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
56+
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
5858
<Private>True</Private>
5959
</Reference>
60-
<Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
61-
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
60+
<Reference Include="Google.Apis.Core, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
61+
<HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
6262
<Private>True</Private>
6363
</Reference>
64-
<Reference Include="Google.Apis.Groupssettings.v1, Version=1.12.0.447, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
65-
<HintPath>..\packages\Google.Apis.Groupssettings.v1.1.12.0.447\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.Groupssettings.v1.dll</HintPath>
64+
<Reference Include="Google.Apis.Groupssettings.v1, Version=1.16.0.510, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
65+
<HintPath>..\packages\Google.Apis.Groupssettings.v1.1.16.0.510\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.Groupssettings.v1.dll</HintPath>
6666
<Private>True</Private>
6767
</Reference>
68-
<Reference Include="Google.Apis.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
69-
<HintPath>..\packages\Google.Apis.1.11.1\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
68+
<Reference Include="Google.Apis.PlatformServices, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
69+
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
7070
<Private>True</Private>
7171
</Reference>
7272
<Reference Include="Google.GData.Apps, Version=2.2.0.0, Culture=neutral, PublicKeyToken=e6feebfe441b89cb, processorArchitecture=MSIL">
@@ -85,25 +85,25 @@
8585
<HintPath>..\packages\Google.GData.Extensions.2.2.0.0\lib\Google.GData.Extensions.dll</HintPath>
8686
<Private>True</Private>
8787
</Reference>
88-
<Reference Include="Lithnet.GoogleApps, Version=1.0.6027.26510, Culture=neutral, processorArchitecture=MSIL">
89-
<HintPath>..\packages\Lithnet.GoogleApps.1.0.6027.26510\lib\net452\Lithnet.GoogleApps.dll</HintPath>
88+
<Reference Include="Lithnet.GoogleApps, Version=1.0.6086.35275, Culture=neutral, processorArchitecture=MSIL">
89+
<HintPath>..\packages\Lithnet.GoogleApps.1.0.6086.35275\lib\net452\Lithnet.GoogleApps.dll</HintPath>
9090
<Private>True</Private>
9191
</Reference>
9292
<Reference Include="Lithnet.Logging, Version=1.0.5774.20685, Culture=neutral, processorArchitecture=MSIL">
9393
<HintPath>..\packages\Lithnet.Logging.1.0.5774.20685\lib\net40\Lithnet.Logging.dll</HintPath>
9494
<Private>True</Private>
9595
</Reference>
96-
<Reference Include="Lithnet.MetadirectoryServices, Version=1.0.6006.11723, Culture=neutral, processorArchitecture=MSIL">
97-
<HintPath>..\packages\Lithnet.MetadirectoryServices.1.0.6006.11723\lib\net40\Lithnet.MetadirectoryServices.dll</HintPath>
96+
<Reference Include="Lithnet.MetadirectoryServices, Version=1.0.6017.24789, Culture=neutral, processorArchitecture=MSIL">
97+
<HintPath>..\packages\Lithnet.MetadirectoryServices.1.0.6017.24789\lib\net40\Lithnet.MetadirectoryServices.dll</HintPath>
9898
<Private>True</Private>
9999
</Reference>
100100
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
101101
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
102102
<Private>True</Private>
103103
</Reference>
104104
<Reference Include="Microsoft.MetadirectoryServicesEx, Version=4.1.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
105-
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
106-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
105+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
106+
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
107107
<Private>True</Private>
108108
</Reference>
109109
<Reference Include="System" />

src/Lithnet.GoogleApps.MA.UnitTests/UserTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public void Update()
261261
Department = "test",
262262
Symbol = "test",
263263
Location = "test",
264+
Type = "work"
264265
});
265266

266267
e.Phones = new List<Phone>();

src/Lithnet.GoogleApps.MA.UnitTests/app.config

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</dependentAssembly>
1616
<dependentAssembly>
1717
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
18-
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
18+
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
1919
</dependentAssembly>
2020
<dependentAssembly>
2121
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
@@ -25,6 +25,26 @@
2525
<assemblyIdentity name="Microsoft.MetadirectoryServicesEx" publicKeyToken="31bf3856ad364e35" culture="neutral" />
2626
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
2727
</dependentAssembly>
28+
<dependentAssembly>
29+
<assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
30+
<bindingRedirect oldVersion="0.0.0.0-1.11.1.0" newVersion="1.11.1.0" />
31+
</dependentAssembly>
32+
<dependentAssembly>
33+
<assemblyIdentity name="Google.Apis.Auth.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
34+
<bindingRedirect oldVersion="0.0.0.0-1.11.1.0" newVersion="1.11.1.0" />
35+
</dependentAssembly>
36+
<dependentAssembly>
37+
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
38+
<bindingRedirect oldVersion="0.0.0.0-1.16.0.0" newVersion="1.16.0.0" />
39+
</dependentAssembly>
40+
<dependentAssembly>
41+
<assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
42+
<bindingRedirect oldVersion="0.0.0.0-1.16.0.0" newVersion="1.16.0.0" />
43+
</dependentAssembly>
44+
<dependentAssembly>
45+
<assemblyIdentity name="Google.Apis.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
46+
<bindingRedirect oldVersion="0.0.0.0-1.16.0.0" newVersion="1.16.0.0" />
47+
</dependentAssembly>
2848
</assemblyBinding>
2949
</runtime>
3050
</configuration>

0 commit comments

Comments
 (0)