This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Showing
19 changed files
with
1,568 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Management.Automation.Runspaces; | ||
|
||
namespace SharePointPnP.PowerShell.Tests.Webs | ||
{ | ||
[TestClass] | ||
public class AddIndexedPropertyTests | ||
{ | ||
#region Test Setup/CleanUp | ||
[ClassInitialize] | ||
public static void Initialize(TestContext testContext) | ||
{ | ||
// This runs on class level once before all tests run | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[ClassCleanup] | ||
public static void Cleanup(TestContext testContext) | ||
{ | ||
// This runs on class level once | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[TestInitialize] | ||
public void Initialize() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
// Example | ||
// scope.ExecuteCommand("cmdlet", new CommandParameter("param1", prop)); | ||
} | ||
} | ||
|
||
[TestCleanup] | ||
public void Cleanup() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
try | ||
{ | ||
// Do Test Setup - Note, this runs PER test | ||
} | ||
catch (Exception) | ||
{ | ||
// Describe Exception | ||
} | ||
} | ||
} | ||
#endregion | ||
|
||
#region Scaffolded Cmdlet Tests | ||
//TODO: This is a scaffold of the cmdlet - complete the unit test | ||
//[TestMethod] | ||
public void AddPnPIndexedPropertyTest() | ||
{ | ||
using (var scope = new PSTestScope(true)) | ||
{ | ||
// Complete writing cmd parameters | ||
|
||
// This is a mandatory parameter | ||
// From Cmdlet Help: Key of the property bag value to be indexed | ||
var key = ""; | ||
// From Cmdlet Help: The list object or name where to set the indexed property | ||
var list = ""; | ||
|
||
var results = scope.ExecuteCommand("Add-PnPIndexedProperty", | ||
new CommandParameter("Key", key), | ||
new CommandParameter("List", list)); | ||
|
||
Assert.IsNotNull(results); | ||
} | ||
} | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Management.Automation.Runspaces; | ||
|
||
namespace SharePointPnP.PowerShell.Tests.Webs | ||
{ | ||
[TestClass] | ||
public class GetAvailableLanguageTests | ||
{ | ||
#region Test Setup/CleanUp | ||
[ClassInitialize] | ||
public static void Initialize(TestContext testContext) | ||
{ | ||
// This runs on class level once before all tests run | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[ClassCleanup] | ||
public static void Cleanup(TestContext testContext) | ||
{ | ||
// This runs on class level once | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[TestInitialize] | ||
public void Initialize() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
// Example | ||
// scope.ExecuteCommand("cmdlet", new CommandParameter("param1", prop)); | ||
} | ||
} | ||
|
||
[TestCleanup] | ||
public void Cleanup() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
try | ||
{ | ||
// Do Test Setup - Note, this runs PER test | ||
} | ||
catch (Exception) | ||
{ | ||
// Describe Exception | ||
} | ||
} | ||
} | ||
#endregion | ||
|
||
#region Scaffolded Cmdlet Tests | ||
//TODO: This is a scaffold of the cmdlet - complete the unit test | ||
//[TestMethod] | ||
public void GetPnPAvailableLanguageTest() | ||
{ | ||
using (var scope = new PSTestScope(true)) | ||
{ | ||
// Complete writing cmd parameters | ||
|
||
// From Cmdlet Help: The guid of the web or web object | ||
var identity = ""; | ||
|
||
var results = scope.ExecuteCommand("Get-PnPAvailableLanguage", | ||
new CommandParameter("Identity", identity)); | ||
|
||
Assert.IsNotNull(results); | ||
} | ||
} | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Management.Automation.Runspaces; | ||
|
||
namespace SharePointPnP.PowerShell.Tests.Webs | ||
{ | ||
[TestClass] | ||
public class GetIndexedPropertiesTests | ||
{ | ||
#region Test Setup/CleanUp | ||
[ClassInitialize] | ||
public static void Initialize(TestContext testContext) | ||
{ | ||
// This runs on class level once before all tests run | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[ClassCleanup] | ||
public static void Cleanup(TestContext testContext) | ||
{ | ||
// This runs on class level once | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[TestInitialize] | ||
public void Initialize() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
// Example | ||
// scope.ExecuteCommand("cmdlet", new CommandParameter("param1", prop)); | ||
} | ||
} | ||
|
||
[TestCleanup] | ||
public void Cleanup() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
try | ||
{ | ||
// Do Test Setup - Note, this runs PER test | ||
} | ||
catch (Exception) | ||
{ | ||
// Describe Exception | ||
} | ||
} | ||
} | ||
#endregion | ||
|
||
#region Scaffolded Cmdlet Tests | ||
//TODO: This is a scaffold of the cmdlet - complete the unit test | ||
//[TestMethod] | ||
public void GetPnPIndexedPropertyKeysTest() | ||
{ | ||
using (var scope = new PSTestScope(true)) | ||
{ | ||
// Complete writing cmd parameters | ||
|
||
// From Cmdlet Help: The list object or name from where to get the indexed properties | ||
var list = ""; | ||
|
||
var results = scope.ExecuteCommand("Get-PnPIndexedPropertyKeys", | ||
new CommandParameter("List", list)); | ||
|
||
Assert.IsNotNull(results); | ||
} | ||
} | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Management.Automation.Runspaces; | ||
|
||
namespace SharePointPnP.PowerShell.Tests.Webs | ||
{ | ||
[TestClass] | ||
public class GetPropertyBagTests | ||
{ | ||
#region Test Setup/CleanUp | ||
[ClassInitialize] | ||
public static void Initialize(TestContext testContext) | ||
{ | ||
// This runs on class level once before all tests run | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[ClassCleanup] | ||
public static void Cleanup(TestContext testContext) | ||
{ | ||
// This runs on class level once | ||
//using (var ctx = TestCommon.CreateClientContext()) | ||
//{ | ||
//} | ||
} | ||
|
||
[TestInitialize] | ||
public void Initialize() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
// Example | ||
// scope.ExecuteCommand("cmdlet", new CommandParameter("param1", prop)); | ||
} | ||
} | ||
|
||
[TestCleanup] | ||
public void Cleanup() | ||
{ | ||
using (var scope = new PSTestScope()) | ||
{ | ||
try | ||
{ | ||
// Do Test Setup - Note, this runs PER test | ||
} | ||
catch (Exception) | ||
{ | ||
// Describe Exception | ||
} | ||
} | ||
} | ||
#endregion | ||
|
||
#region Scaffolded Cmdlet Tests | ||
//TODO: This is a scaffold of the cmdlet - complete the unit test | ||
//[TestMethod] | ||
public void GetPnPPropertyBagTest() | ||
{ | ||
using (var scope = new PSTestScope(true)) | ||
{ | ||
// Complete writing cmd parameters | ||
|
||
// From Cmdlet Help: Key that should be looked up | ||
var key = ""; | ||
// From Cmdlet Help: Site relative url of the folder. See examples for use. | ||
var folder = ""; | ||
|
||
var results = scope.ExecuteCommand("Get-PnPPropertyBag", | ||
new CommandParameter("Key", key), | ||
new CommandParameter("Folder", folder)); | ||
|
||
Assert.IsNotNull(results); | ||
} | ||
} | ||
#endregion | ||
} | ||
} | ||
|
Oops, something went wrong.