Skip to content

Commit 7c4cea7

Browse files
committed
7.6.1 release
1 parent 0306fd2 commit 7c4cea7

27 files changed

+584
-312
lines changed

.vscode/extensions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"editorconfig.editorconfig",
4+
"github.vscode-github-actions",
5+
"ms-dotnettools.csdevkit",
6+
"redhat.vscode-yaml",
7+
"redhat.vscode-xml"
8+
]
9+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.exclude": {
3+
"source/": true
4+
}
5+
}

source/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ dotnet_naming_style.begins_with_i.required_suffix =
246246
dotnet_naming_style.begins_with_i.word_separator =
247247
dotnet_naming_style.begins_with_i.capitalization = pascal_case
248248

249+
#### .NET Code Analysis Rules ####
250+
251+
dotnet_diagnostic.IDE0005.severity = warning
252+
249253
#### ReSharper Code inspection Rules ####
250254

251255
resharper_redundant_attribute_parentheses_highlighting = none

source/.vscode/tasks.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"command": "jb",
4545
"args": [
4646
"cleanupcode",
47-
"--profile=\"Built-in: Reformat Code\"",
47+
"--profile='Built-in: Reformat Code'",
48+
"--exclude='**/*.config'",
4849
"${workspaceFolder}/Karamem0.SPClientCore.sln"
4950
],
5051
"problemMatcher": []

source/Karamem0.SPClientCore.Test/Commands/AddColumnCalculatedCommandTests.cs

Lines changed: 65 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,12 @@ public void InvokeCommand_AddBooleanToSite_ShouldSucceed()
501501
}
502502
);
503503
var result1 = context.Runspace.InvokeCommand<Column>(
504-
"Get-KshColumn",
504+
"Add-KshColumnBoolean",
505505
new Dictionary<string, object>()
506506
{
507-
["ColumnId"] = context.AppSettings["Column10Id"]
507+
["Name"] = "TestColumn99",
508+
["Title"] = "Test Column 99",
509+
["AddColumnInternalNameHint"] = true
508510
}
509511
);
510512
var result2 = context.Runspace.InvokeCommand<ColumnCalculated>(
@@ -520,7 +522,7 @@ public void InvokeCommand_AddBooleanToSite_ShouldSucceed()
520522
["CustomFormatter"] = /*lang=json,strict*/ "{ \"txtContent\": \"@currentField\" }",
521523
["Description"] = "Test Column 0 Description",
522524
["Direction"] = "none",
523-
["Formula"] = "=TestColumn10",
525+
["Formula"] = "=TestColumn99",
524526
["Group"] = "Test Column 0 Group",
525527
["Hidden"] = true,
526528
["Id"] = "35aa78a6-66d7-472c-ab6b-d534193842af",
@@ -549,6 +551,13 @@ public void InvokeCommand_AddBooleanToSite_ShouldSucceed()
549551
["Identity"] = result2[0]
550552
}
551553
);
554+
_ = context.Runspace.InvokeCommand(
555+
"Remove-KshColumn",
556+
new Dictionary<string, object>()
557+
{
558+
["Identity"] = result1[0]
559+
}
560+
);
552561
var actual = result2[0];
553562
Assert.That(actual, Is.Not.Null);
554563
}
@@ -568,10 +577,12 @@ public void InvokeCommand_AddCurrencyToSite_ShouldSucceed()
568577
}
569578
);
570579
var result1 = context.Runspace.InvokeCommand<Column>(
571-
"Get-KshColumn",
580+
"Add-KshColumnCurrency",
572581
new Dictionary<string, object>()
573582
{
574-
["ColumnId"] = context.AppSettings["Column6Id"]
583+
["Name"] = "TestColumn99",
584+
["Title"] = "Test Column 99",
585+
["AddColumnInternalNameHint"] = true
575586
}
576587
);
577588
var result2 = context.Runspace.InvokeCommand<ColumnCalculated>(
@@ -588,7 +599,7 @@ public void InvokeCommand_AddCurrencyToSite_ShouldSucceed()
588599
["CustomFormatter"] = /*lang=json,strict*/ "{ \"txtContent\": \"@currentField\" }",
589600
["Description"] = "Test Column 0 Description",
590601
["Direction"] = "none",
591-
["Formula"] = "=TestColumn6",
602+
["Formula"] = "=TestColumn99",
592603
["Group"] = "Test Column 0 Group",
593604
["Hidden"] = true,
594605
["Id"] = "35aa78a6-66d7-472c-ab6b-d534193842af",
@@ -618,6 +629,13 @@ public void InvokeCommand_AddCurrencyToSite_ShouldSucceed()
618629
["Identity"] = result2[0]
619630
}
620631
);
632+
_ = context.Runspace.InvokeCommand(
633+
"Remove-KshColumn",
634+
new Dictionary<string, object>()
635+
{
636+
["Identity"] = result1[0]
637+
}
638+
);
621639
var actual = result2[0];
622640
Assert.That(actual, Is.Not.Null);
623641
}
@@ -637,10 +655,12 @@ public void InvokeCommand_AddDateTimeToSite_ShouldSucceed()
637655
}
638656
);
639657
var result1 = context.Runspace.InvokeCommand<Column>(
640-
"Get-KshColumn",
658+
"Add-KshColumnDateTime",
641659
new Dictionary<string, object>()
642660
{
643-
["ColumnId"] = context.AppSettings["Column7Id"]
661+
["Name"] = "TestColumn99",
662+
["Title"] = "Test Column 99",
663+
["AddColumnInternalNameHint"] = true
644664
}
645665
);
646666
var result2 = context.Runspace.InvokeCommand<ColumnCalculated>(
@@ -657,7 +677,7 @@ public void InvokeCommand_AddDateTimeToSite_ShouldSucceed()
657677
["DateFormat"] = "DateTime",
658678
["Description"] = "Test Column 0 Description",
659679
["Direction"] = "none",
660-
["Formula"] = "=TestColumn7",
680+
["Formula"] = "=TestColumn99",
661681
["Group"] = "Test Column 0 Group",
662682
["Hidden"] = true,
663683
["Id"] = "35aa78a6-66d7-472c-ab6b-d534193842af",
@@ -686,6 +706,13 @@ public void InvokeCommand_AddDateTimeToSite_ShouldSucceed()
686706
["Identity"] = result2[0]
687707
}
688708
);
709+
_ = context.Runspace.InvokeCommand(
710+
"Remove-KshColumn",
711+
new Dictionary<string, object>()
712+
{
713+
["Identity"] = result1[0]
714+
}
715+
);
689716
var actual = result2[0];
690717
Assert.That(actual, Is.Not.Null);
691718
}
@@ -705,10 +732,12 @@ public void InvokeCommand_AddNumberToSite_ShouldSucceed()
705732
}
706733
);
707734
var result1 = context.Runspace.InvokeCommand<Column>(
708-
"Get-KshColumn",
735+
"Add-KshColumnNumber",
709736
new Dictionary<string, object>()
710737
{
711-
["ColumnId"] = context.AppSettings["Column5Id"]
738+
["Name"] = "TestColumn99",
739+
["Title"] = "Test Column 99",
740+
["AddColumnInternalNameHint"] = true
712741
}
713742
);
714743
var result2 = context.Runspace.InvokeCommand<ColumnCalculated>(
@@ -724,7 +753,7 @@ public void InvokeCommand_AddNumberToSite_ShouldSucceed()
724753
["CustomFormatter"] = /*lang=json,strict*/ "{ \"txtContent\": \"@currentField\" }",
725754
["Description"] = "Test Column 0 Description",
726755
["Direction"] = "none",
727-
["Formula"] = "=TestColumn5",
756+
["Formula"] = "=TestColumn99",
728757
["Group"] = "Test Column 0 Group",
729758
["Hidden"] = true,
730759
["Id"] = "35aa78a6-66d7-472c-ab6b-d534193842af",
@@ -755,6 +784,13 @@ public void InvokeCommand_AddNumberToSite_ShouldSucceed()
755784
["Identity"] = result2[0]
756785
}
757786
);
787+
_ = context.Runspace.InvokeCommand(
788+
"Remove-KshColumn",
789+
new Dictionary<string, object>()
790+
{
791+
["Identity"] = result1[0]
792+
}
793+
);
758794
var actual = result2[0];
759795
Assert.That(actual, Is.Not.Null);
760796
}
@@ -774,33 +810,28 @@ public void InvokeCommand_AddTextToSite_ShouldSucceed()
774810
}
775811
);
776812
var result1 = context.Runspace.InvokeCommand<Column>(
777-
"Get-KshColumn",
778-
new Dictionary<string, object>()
779-
{
780-
["ColumnId"] = context.AppSettings["Column1Id"]
781-
}
782-
);
783-
var result2 = context.Runspace.InvokeCommand<Column>(
784-
"Get-KshColumn",
813+
"Add-KshColumnText",
785814
new Dictionary<string, object>()
786815
{
787-
["ColumnId"] = context.AppSettings["Column3Id"]
816+
["Name"] = "TestColumn99",
817+
["Title"] = "Test Column 99",
818+
["AddColumnInternalNameHint"] = true
788819
}
789820
);
790-
var result3 = context.Runspace.InvokeCommand<ColumnCalculated>(
821+
var result2 = context.Runspace.InvokeCommand<ColumnCalculated>(
791822
"Add-KshColumnCalculated",
792823
new Dictionary<string, object>()
793824
{
794825
// { "ClientSideComponentId", null },
795826
// { "ClientSideComponentProperties", null },
796827
["Columns"] = new[]
797828
{
798-
result1[0], result2[0]
829+
result1[0]
799830
},
800831
["CustomFormatter"] = /*lang=json,strict*/ "{ \"txtContent\": \"@currentField\" }",
801832
["Description"] = "Test Column 0 Description",
802833
["Direction"] = "none",
803-
["Formula"] = "=TestColumn1&TestColumn3",
834+
["Formula"] = "=TestColumn99",
804835
["Group"] = "Test Column 0 Group",
805836
["Hidden"] = true,
806837
["Id"] = "35aa78a6-66d7-472c-ab6b-d534193842af",
@@ -818,18 +849,25 @@ public void InvokeCommand_AddTextToSite_ShouldSucceed()
818849
"Set-KshColumnCalculated",
819850
new Dictionary<string, object>()
820851
{
821-
["Identity"] = result3[0],
852+
["Identity"] = result2[0],
822853
["Hidden"] = false
823854
}
824855
);
825856
_ = context.Runspace.InvokeCommand(
826857
"Remove-KshColumn",
827858
new Dictionary<string, object>()
828859
{
829-
["Identity"] = result3[0]
860+
["Identity"] = result2[0]
830861
}
831862
);
832-
var actual = result3[0];
863+
_ = context.Runspace.InvokeCommand(
864+
"Remove-KshColumn",
865+
new Dictionary<string, object>()
866+
{
867+
["Identity"] = result1[0]
868+
}
869+
);
870+
var actual = result2[0];
833871
Assert.That(actual, Is.Not.Null);
834872
}
835873

source/Karamem0.SPClientCore.Test/Commands/GetTenantHomeSiteCommandTests.cs

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// https://github.com/karamem0/sp-client-core/blob/main/LICENSE
77
//
88

9+
using Karamem0.SharePoint.PowerShell.Models.V1;
910
using Karamem0.SharePoint.PowerShell.Test.Utility;
1011
using NUnit.Framework;
1112

@@ -29,13 +30,57 @@ public void InvokeCommand_GetOne_ShouldSucceed()
2930
["PrivateKeyPath"] = context.AppSettings["PrivateKeyPath"]
3031
}
3132
);
32-
var result1 = context.Runspace.InvokeCommand<Uri>(
33+
var result1 = context.Runspace.InvokeCommand<TenantSiteCollection>(
34+
"Add-KshTenantSiteCollection",
35+
new Dictionary<string, object>()
36+
{
37+
["Owner"] = context.AppSettings["OwnerUserName"],
38+
["Template"] = "SITEPAGEPUBLISHING#0",
39+
["Url"] = context.AppSettings["AuthorityUrl"] + "/sites/TestSite0"
40+
}
41+
);
42+
var result2 = context.Runspace.InvokeCommand<Uri>(
43+
"Set-KshTenantHomeSite",
44+
new Dictionary<string, object>()
45+
{
46+
["Url"] = result1[0].Url,
47+
["PassThru"] = true
48+
}
49+
);
50+
var result3 = context.Runspace.InvokeCommand<Uri>(
3351
"Get-KshTenantHomeSite",
3452
new Dictionary<string, object>()
3553
{
3654
}
3755
);
38-
var actual = result1[0];
56+
_ = context.Runspace.InvokeCommand(
57+
"Remove-KshTenantHomeSite",
58+
new Dictionary<string, object>()
59+
{
60+
}
61+
);
62+
_ = context.Runspace.InvokeCommand(
63+
"Remove-KshTenantSiteCollection",
64+
new Dictionary<string, object>()
65+
{
66+
["Identity"] = result1[0]
67+
}
68+
);
69+
var result4 = context.Runspace.InvokeCommand<TenantDeletedSiteCollection>(
70+
"Get-KshTenantDeletedSiteCollection",
71+
new Dictionary<string, object>()
72+
{
73+
["SiteCollectionUrl"] = result1[0].Url
74+
}
75+
);
76+
_ = context.Runspace.InvokeCommand(
77+
"Remove-KshTenantDeletedSiteCollection",
78+
new Dictionary<string, object>()
79+
{
80+
["Identity"] = result4[0]
81+
}
82+
);
83+
var actual = result3[0];
3984
Assert.That(actual, Is.Not.Null);
4085
}
4186

source/Karamem0.SPClientCore.Test/Commands/SetColumnBooleanCommandTests.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ public void InvokeCommand_SetItemToList_ShouldSucceed()
3131
}
3232
);
3333
var result1 = context.Runspace.InvokeCommand<List>(
34-
"Get-KshList",
34+
"Add-KshList",
3535
new Dictionary<string, object>()
3636
{
37-
["ListId"] = context.AppSettings["List1Id"]
37+
["Template"] = "GenericList",
38+
["Title"] = "Test List 0"
3839
}
3940
);
4041
var result2 = context.Runspace.InvokeCommand<Column>(
@@ -86,6 +87,13 @@ public void InvokeCommand_SetItemToList_ShouldSucceed()
8687
["Identity"] = result3[0]
8788
}
8889
);
90+
_ = context.Runspace.InvokeCommand<Guid>(
91+
"Remove-KshList",
92+
new Dictionary<string, object>()
93+
{
94+
["Identity"] = result1[0]
95+
}
96+
);
8997
var actual = result3[0];
9098
Assert.That(actual, Is.Not.Null);
9199
}

0 commit comments

Comments
 (0)