Skip to content

Commit

Permalink
SPMeta2 1.1.100 release, June 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
SubPointSupport committed Jun 14, 2015
1 parent be2598c commit ea17af7
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 10 deletions.
Binary file modified SPMeta2.v12.suo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.SharePoint.Client;
using SPMeta2.Common;
using SPMeta2.CSOM.Extensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Text;
using SPMeta2.Containers.Services;
using SPMeta2.Containers.Services.Base;
using SPMeta2.Definitions;
using SPMeta2.Definitions.Base;
Expand All @@ -19,7 +20,7 @@ public override DefinitionBase GenerateRandomDefinition(Action<DefinitionBase> a
def.ZoneId = "FullPage";
def.ZoneIndex = Rnd.Int(100);

// TODO
def.ContentLink = Rnd.HttpUrl();
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override void DeployModel(object modelHost, DefinitionBase model)

if (!string.IsNullOrEmpty(definition.ContentLink))
{
var value = CurrentWebPartXml.GetProperty("ContentLink");
var value = CurrentWebPartXml.GetPageViewerWebPartProperty("ContentLink");

assert.ShouldBeEqual((p, s, d) =>
{
Expand All @@ -58,7 +58,7 @@ public override void DeployModel(object modelHost, DefinitionBase model)

if (!string.IsNullOrEmpty(definition.SourceType))
{
var value = CurrentWebPartXml.GetProperty("SourceType");
var value = CurrentWebPartXml.GetPageViewerWebPartProperty("SourceType");

assert.ShouldBeEqual((p, s, d) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.SharePoint.WebPartPages;
using SPMeta2.Definitions;
using SPMeta2.Definitions.Base;
using SPMeta2.Definitions.Webparts;
using SPMeta2.SSOM.Extensions;
using SPMeta2.SSOM.ModelHosts;
using SPMeta2.Utils;

namespace SPMeta2.Regression.SSOM.Validation.Webparts
{
Expand All @@ -27,10 +30,41 @@ public override void DeployModel(object modelHost, DefinitionBase model)
// base validation
base.DeployModel(modelHost, model);

// web specific validation
var host = modelHost.WithAssertAndCast<WebpartPageModelHost>("modelHost", value => value.RequireNotNull());
var definition = model.WithAssertAndCast<PageViewerWebPartDefinition>("model", value => value.RequireNotNull());

var item = host.PageListItem;

WebPartExtensions.WithExistingWebPart(item, definition, (spWebPartManager, spObject) =>
{
var web = spWebPartManager.Web;
var typedObject = spObject as PageViewerWebPart;

var assert = ServiceFactory.AssertService
.NewAssert(definition, typedObject)
.ShouldNotBeNull(typedObject);

if (!string.IsNullOrEmpty(definition.ContentLink))
assert.ShouldBeEqual(m => m.ContentLink, o => o.ContentLink);
else
assert.SkipProperty(m => m.ContentLink);

// content editor specific validation
if (!string.IsNullOrEmpty(definition.SourceType))
assert.ShouldBeEqual(m => m.SourceType, o => o.GetSourceType());
else
assert.SkipProperty(m => m.SourceType);
});
}

#endregion
}

internal static class PageViewerWebPartExtensions
{
public static string GetSourceType(this PageViewerWebPart wp)
{
return wp.SourceType.ToString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ M2ShowSettings $g_M2TestEnvironment

# CSOM, SSOM, O365
SetupSPMeta2RegressionTestEnvironment "SSOM"
SetupSPMeta2RegressionTestEnvironment "CSOM"
#SetupSPMeta2RegressionTestEnvironment "CSOM"
#SetupSPMeta2RegressionTestEnvironment "O365"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ protected override void ProcessWebpartProperties(WebPart webpartInstance, WebPar
if (typedModel.DisableColumnFiltering.HasValue)
typedWebpart.DisableColumnFiltering = typedModel.DisableColumnFiltering.Value;

#if !NET35
if (typedModel.DisableSaveAsNewViewButton.HasValue)
typedWebpart.DisableSaveAsNewViewButton = typedModel.DisableSaveAsNewViewButton.Value;

Expand All @@ -178,7 +179,7 @@ protected override void ProcessWebpartProperties(WebPart webpartInstance, WebPar

if (typedModel.InplaceSearchEnabled.HasValue)
typedWebpart.InplaceSearchEnabled = typedModel.InplaceSearchEnabled.Value;

#endif
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,22 @@ namespace SPMeta2.Definitions.Webparts
[DataContract]
public class PageViewerWebPartDefinition : WebPartDefinition
{
#region constructors


#endregion

#region properties

[ExpectValidation]
[DataMember]
[ExpectNullable]
[ExpectUpdateAsUrl]
public string ContentLink { get; set; }

[ExpectValidation]
[DataMember]
[ExpectNullable]
public string SourceType { get; set; }

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SPMeta2.Services.Impl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SPMeta2.Services
{
Expand Down

0 comments on commit ea17af7

Please sign in to comment.