Skip to content

Commit

Permalink
Adds support for new group settings attributes reported in issue #3
Browse files Browse the repository at this point in the history
Updates google api packages, and fixes compatibility issues with the new builds
  • Loading branch information
ryannewington committed Aug 30, 2016
1 parent 03c1240 commit 37ea10a
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 123 deletions.
2 changes: 1 addition & 1 deletion src/Lithnet.GoogleApps.MA.Setup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Product Id="*"
Name="Lithnet GoogleApps Management Agent"
Language="1033"
Version="1.1.6049"
Version="1.1.6086"
Manufacturer="Lithnet"
UpgradeCode="3410d571b358426281edb2990ae57cae" >

Expand Down
1 change: 1 addition & 0 deletions src/Lithnet.GoogleApps.MA.UnitTests/AdvancedUserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public void Update()
Department = "test",
Symbol = "test",
Location = "test",
Type = "work"
});

e.Phones = new List<Phone>();
Expand Down
58 changes: 19 additions & 39 deletions src/Lithnet.GoogleApps.MA.UnitTests/GroupTests.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Lithnet.GoogleApps;
using Lithnet.GoogleApps.MA;
using Microsoft.MetadirectoryServices;
using System.Linq;
using System.Net;
using Google;
using Google.Apis.Admin.Directory.directory_v1.Data;
using Lithnet.GoogleApps.ManagedObjects;
using Lithnet.MetadirectoryServices;

namespace Lithnet.GoogleApps.MA.UnitTests
{
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Google;
using Google.Apis.Admin.Directory.directory_v1.Data;
using Google.GData.Contacts;
using Google.GData.Extensions;
using Lithnet.GoogleApps.MA;
using ManagedObjects;
using MetadirectoryServices;
using Microsoft.MetadirectoryServices;

[TestClass]
public class GroupTests
{
Expand All @@ -39,9 +30,11 @@ public void Add()
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("allowWebPosting", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("archiveOnly", false));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("customReplyTo", "[email protected]"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("customFooterText", "custom footer"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("defaultMessageDenyNotificationText", "occupation"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("includeInGlobalAddressList", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("isArchived", false));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("includeCustomFooter", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("maxMessageBytes", 5000000));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("membersCanPostAsTheGroup", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("messageDisplayFont", "DEFAULT_FONT"));
Expand All @@ -50,6 +43,7 @@ public void Add()
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("sendMessageDenyNotification", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("showInGroupDirectory", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("spamModerationLevel", "SILENTLY_MODERATE"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanAdd", "ALL_MANAGERS_CAN_ADD"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanContactOwner", "ANYONE_CAN_CONTACT"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanInvite", "NONE_CAN_INVITE"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanJoin", "CAN_REQUEST_TO_JOIN"));
Expand Down Expand Up @@ -91,8 +85,10 @@ public void Add()
Assert.AreEqual(true, s.AllowWebPosting);
Assert.AreEqual(false, s.ArchiveOnly);
Assert.AreEqual("[email protected]", s.CustomReplyTo);
Assert.AreEqual("custom footer", s.CustomFooterText);
Assert.AreEqual("occupation", s.DefaultMessageDenyNotificationText);
Assert.AreEqual(true, s.IncludeInGlobalAddressList);
Assert.AreEqual(true, s.IncludeCustomFooter);
Assert.AreEqual(false, s.IsArchived);
Assert.AreEqual(5000000, s.MaxMessageBytes);
Assert.AreEqual(true, s.MembersCanPostAsTheGroup);
Expand All @@ -103,6 +99,7 @@ public void Add()
Assert.AreEqual(true, s.ShowInGroupDirectory);
Assert.AreEqual("SILENTLY_MODERATE", s.SpamModerationLevel);
Assert.AreEqual(true, s.ShowInGroupDirectory);
Assert.AreEqual("ALL_MANAGERS_CAN_ADD", s.WhoCanAdd);
Assert.AreEqual("ANYONE_CAN_CONTACT", s.WhoCanContactOwner);
Assert.AreEqual("NONE_CAN_INVITE", s.WhoCanInvite);
Assert.AreEqual("CAN_REQUEST_TO_JOIN", s.WhoCanJoin);
Expand Down Expand Up @@ -151,9 +148,11 @@ public void Update()
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("allowWebPosting", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("archiveOnly", false));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("customReplyTo", "[email protected]"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("customFooterText", "custom footer"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("defaultMessageDenyNotificationText", "occupation"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("includeInGlobalAddressList", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("isArchived", false));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("includeCustomFooter", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("maxMessageBytes", 5000000));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("membersCanPostAsTheGroup", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("messageDisplayFont", "DEFAULT_FONT"));
Expand All @@ -162,6 +161,7 @@ public void Update()
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("sendMessageDenyNotification", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("showInGroupDirectory", true));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("spamModerationLevel", "SILENTLY_MODERATE"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanAdd", "ALL_MANAGERS_CAN_ADD"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanContactOwner", "ANYONE_CAN_CONTACT"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanInvite", "NONE_CAN_INVITE"));
cs.AttributeChanges.Add(AttributeChange.CreateAttributeAdd("whoCanJoin", "CAN_REQUEST_TO_JOIN"));
Expand Down Expand Up @@ -199,8 +199,10 @@ public void Update()
Assert.AreEqual(true, s.AllowWebPosting);
Assert.AreEqual(false, s.ArchiveOnly);
Assert.AreEqual("[email protected]", s.CustomReplyTo);
Assert.AreEqual("custom footer", s.CustomFooterText);
Assert.AreEqual("occupation", s.DefaultMessageDenyNotificationText);
Assert.AreEqual(true, s.IncludeInGlobalAddressList);
Assert.AreEqual(true, s.IncludeCustomFooter);
Assert.AreEqual(false, s.IsArchived);
Assert.AreEqual(5000000, s.MaxMessageBytes);
Assert.AreEqual(true, s.MembersCanPostAsTheGroup);
Expand All @@ -211,6 +213,7 @@ public void Update()
Assert.AreEqual(true, s.ShowInGroupDirectory);
Assert.AreEqual("SILENTLY_MODERATE", s.SpamModerationLevel);
Assert.AreEqual(true, s.ShowInGroupDirectory);
Assert.AreEqual("ALL_MANAGERS_CAN_ADD", s.WhoCanAdd);
Assert.AreEqual("ANYONE_CAN_CONTACT", s.WhoCanContactOwner);
Assert.AreEqual("NONE_CAN_INVITE", s.WhoCanInvite);
Assert.AreEqual("CAN_REQUEST_TO_JOIN", s.WhoCanJoin);
Expand Down Expand Up @@ -449,29 +452,6 @@ public void RemoveAliases()

}

[TestMethod]
public void test()
{
string id = null;
string dn = $"{Guid.NewGuid()}-d1@{UnitTestControl.TestParameters.Domain}";
Group e = new Group
{
Email = dn,
Name = Guid.NewGuid().ToString()
};

e = GroupRequestFactory.Add(e);
id = e.Id;

string alias1 = $"{Guid.NewGuid()}@{UnitTestControl.TestParameters.Domain}";
string alias2 = $"{Guid.NewGuid()}@{UnitTestControl.TestParameters.Domain}";
string alias3 = $"{Guid.NewGuid()}@{UnitTestControl.TestParameters.Domain}";

GroupRequestFactory.AddAlias(id, alias1);
GroupRequestFactory.AddAlias(id, alias2);

}

[TestMethod]
public void AddAlias()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
<Reference Include="BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.11.1\lib\net45\Google.Apis.dll</HintPath>
<Reference Include="Google.Apis, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis.Admin.Directory.directory_v1, Version=1.12.0.447, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<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>
<Reference Include="Google.Apis.Admin.Directory.directory_v1, Version=1.16.0.601, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<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>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
<Reference Include="Google.Apis.Auth, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
<Reference Include="Google.Apis.Core, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis.Groupssettings.v1, Version=1.12.0.447, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Groupssettings.v1.1.12.0.447\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.Groupssettings.v1.dll</HintPath>
<Reference Include="Google.Apis.Groupssettings.v1, Version=1.16.0.510, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.Groupssettings.v1.1.16.0.510\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.Groupssettings.v1.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.Apis.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.11.1\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
<Reference Include="Google.Apis.PlatformServices, Version=1.16.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.GData.Apps, Version=2.2.0.0, Culture=neutral, PublicKeyToken=e6feebfe441b89cb, processorArchitecture=MSIL">
Expand All @@ -85,25 +85,25 @@
<HintPath>..\packages\Google.GData.Extensions.2.2.0.0\lib\Google.GData.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Lithnet.GoogleApps, Version=1.0.6027.26510, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.GoogleApps.1.0.6027.26510\lib\net452\Lithnet.GoogleApps.dll</HintPath>
<Reference Include="Lithnet.GoogleApps, Version=1.0.6086.35275, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.GoogleApps.1.0.6086.35275\lib\net452\Lithnet.GoogleApps.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Lithnet.Logging, Version=1.0.5774.20685, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.Logging.1.0.5774.20685\lib\net40\Lithnet.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Lithnet.MetadirectoryServices, Version=1.0.6006.11723, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.MetadirectoryServices.1.0.6006.11723\lib\net40\Lithnet.MetadirectoryServices.dll</HintPath>
<Reference Include="Lithnet.MetadirectoryServices, Version=1.0.6017.24789, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lithnet.MetadirectoryServices.1.0.6017.24789\lib\net40\Lithnet.MetadirectoryServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.MetadirectoryServicesEx, Version=4.1.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
1 change: 1 addition & 0 deletions src/Lithnet.GoogleApps.MA.UnitTests/UserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public void Update()
Department = "test",
Symbol = "test",
Location = "test",
Type = "work"
});

e.Phones = new List<Phone>();
Expand Down
22 changes: 21 additions & 1 deletion src/Lithnet.GoogleApps.MA.UnitTests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
Expand All @@ -25,6 +25,26 @@
<assemblyIdentity name="Microsoft.MetadirectoryServicesEx" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.11.1.0" newVersion="1.11.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Auth.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.11.1.0" newVersion="1.11.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.16.0.0" newVersion="1.16.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.16.0.0" newVersion="1.16.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.PlatformServices" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.16.0.0" newVersion="1.16.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Loading

0 comments on commit 37ea10a

Please sign in to comment.