-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4917fc
commit 21d6b48
Showing
21 changed files
with
105 additions
and
119 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 43 additions & 58 deletions
101
SPMeta2/SPMeta2.Regression.CSOM/Validation/Fields/BusinessDataFieldDefinitionValidator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,43 @@ | ||
using SPMeta2.CSOM.ModelHandlers.Fields; | ||
using SPMeta2.CSOM.ModelHosts; | ||
using SPMeta2.Definitions; | ||
using SPMeta2.Definitions.Base; | ||
using SPMeta2.Definitions.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
using SPMeta2.Regression.CSOM.Utils; | ||
using SPMeta2.Utils; | ||
using Microsoft.SharePoint.Client; | ||
using SPMeta2.Exceptions; | ||
using System.Xml.Linq; | ||
|
||
namespace SPMeta2.Regression.CSOM.Validation.Fields | ||
{ | ||
public class BusinessDataFieldDefinitionValidator : ClientFieldDefinitionValidator | ||
{ | ||
public override Type TargetType | ||
{ | ||
get { return typeof(BusinessDataFieldDefinition); } | ||
} | ||
|
||
public override void DeployModel(object modelHost, DefinitionBase model) | ||
{ | ||
base.DeployModel(modelHost, model); | ||
|
||
var siteModelHost = modelHost.WithAssertAndCast<SiteModelHost>("modelHost", value => value.RequireNotNull()); | ||
var definition = model.WithAssertAndCast<BusinessDataFieldDefinition>("model", value => value.RequireNotNull()); | ||
|
||
var spObject = FindField(modelHost, definition); | ||
|
||
var assert = ServiceFactory.AssertService.NewAssert(model, definition, spObject); | ||
|
||
assert | ||
.ShouldBeEqual(m => m.Title, o => o.Title) | ||
.ShouldBeEqual(m => m.InternalName, o => o.InternalName) | ||
.ShouldBeEqual(m => m.Id, o => o.Id) | ||
.ShouldBeEqual(m => m.Required, o => o.Required) | ||
.ShouldBeEqual(m => m.Description, o => o.Description) | ||
.ShouldBeEqual(m => m.FieldType, o => o.TypeAsString) | ||
.ShouldBeEqual(m => m.Group, o => o.Group) | ||
|
||
.ShouldBeEqual(m => m.SystemInstanceName, o => o.GetSystemInstanceName()) | ||
.ShouldBeEqual(m => m.EntityNamespace, o => o.GetEntityNamespace()) | ||
.ShouldBeEqual(m => m.EntityName, o => o.GetEntityName()) | ||
.ShouldBeEqual(m => m.BdcFieldName, o => o.GetBdcFieldName()); | ||
|
||
} | ||
} | ||
|
||
//internal static class BCSFieldExt | ||
//{ | ||
|
||
//} | ||
} | ||
using SPMeta2.CSOM.ModelHandlers.Fields; | ||
using SPMeta2.CSOM.ModelHosts; | ||
using SPMeta2.Definitions; | ||
using SPMeta2.Definitions.Base; | ||
using SPMeta2.Definitions.Fields; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
using SPMeta2.Regression.CSOM.Utils; | ||
using SPMeta2.Utils; | ||
using Microsoft.SharePoint.Client; | ||
using SPMeta2.Exceptions; | ||
using System.Xml.Linq; | ||
|
||
namespace SPMeta2.Regression.CSOM.Validation.Fields | ||
{ | ||
public class BusinessDataFieldDefinitionValidator : ClientFieldDefinitionValidator | ||
{ | ||
public override Type TargetType | ||
{ | ||
get { return typeof(BusinessDataFieldDefinition); } | ||
} | ||
|
||
public override void DeployModel(object modelHost, DefinitionBase model) | ||
{ | ||
base.DeployModel(modelHost, model); | ||
|
||
var definition = model.WithAssertAndCast<BusinessDataFieldDefinition>("model", value => value.RequireNotNull()); | ||
var spObject = FindField(modelHost, definition); | ||
|
||
var assert = ServiceFactory.AssertService | ||
.NewAssert(model, definition, spObject); | ||
|
||
assert | ||
.ShouldBeEqual(m => m.SystemInstanceName, o => o.GetSystemInstanceName()) | ||
.ShouldBeEqual(m => m.EntityNamespace, o => o.GetEntityNamespace()) | ||
.ShouldBeEqual(m => m.EntityName, o => o.GetEntityName()) | ||
.ShouldBeEqual(m => m.BdcFieldName, o => o.GetBdcFieldName()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 43 additions & 43 deletions
86
SPMeta2/SPMeta2.Standard/Definitions/Base/ReusableItemDefinitionBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using SPMeta2.Attributes.Regression; | ||
using SPMeta2.Definitions; | ||
|
||
namespace SPMeta2.Standard.Definitions.Base | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
|
||
using SPMeta2.Attributes.Regression; | ||
using SPMeta2.Definitions; | ||
|
||
namespace SPMeta2.Standard.Definitions.Base | ||
{ | ||
public abstract class ReusableItemDefinitionBase : ListItemDefinition | ||
{ | ||
#region constructors | ||
|
||
public ReusableItemDefinitionBase() | ||
{ | ||
Overwrite = true; | ||
AutomaticUpdate = true; | ||
} | ||
|
||
#endregion | ||
|
||
#region properties | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public string Comments { get; set; } | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public string ContentCategory { get; set; } | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public bool AutomaticUpdate { get; set; } | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public bool ShowInDropDownMenu { get; set; } | ||
|
||
#endregion | ||
} | ||
} | ||
public abstract class ReusableItemDefinitionBase : ListItemDefinition | ||
{ | ||
#region constructors | ||
|
||
public ReusableItemDefinitionBase() | ||
{ | ||
Overwrite = true; | ||
AutomaticUpdate = true; | ||
} | ||
|
||
#endregion | ||
|
||
#region properties | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public string Comments { get; set; } | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public string ContentCategory { get; set; } | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public bool AutomaticUpdate { get; set; } | ||
|
||
[ExpectValidation] | ||
[DataMember] | ||
public bool ShowInDropDownMenu { get; set; } | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters