From 0ee1846c725eac90600b6dd566aeec15fda97d3a Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Sun, 13 Oct 2024 10:41:24 -0700 Subject: [PATCH] Created Tests --- .vscode/.json | 462 ++++++++++--------------------- .vscode/launch.json | 12 +- .vscode/tasks.json | 7 +- ADO2024/PI1/Helper-2024-01-08.cs | 34 ++- ADO2024/PI3/Helper-2024-09-11.cs | 382 ++++++++++++++----------- File-Folder-Helper.csproj | 10 +- 6 files changed, 424 insertions(+), 483 deletions(-) diff --git a/.vscode/.json b/.vscode/.json index 2e529b0..4bfafc3 100644 --- a/.vscode/.json +++ b/.vscode/.json @@ -1,312 +1,154 @@ [ - { - "id": "403675d4-631e-40bb-900e-fae36d9c9cdd", - "deviceAssetId": "449501900719.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/71/449501900719.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/40/36/403675d4-631e-40bb-900e-fae36d9c9cdd-preview.jpeg", - "fileCreatedAt": "2016-12-02T02:34:23-07:00", - "fileModifiedAt": "2016-12-02T02:34:22-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/40/36/403675d4-631e-40bb-900e-fae36d9c9cdd-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\x28b46dbf4864b92f18800815cf8145c38d037e92", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:13:20.074314-07:00", - "createdAt": "2024-04-25T10:14:24.253144-07:00", - "isArchived": false, - "originalFileName": "449501900719.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\xe5a9090d8257787870788886886877776870760aa9", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2016-12-01T19:34:23-07:00", - "stackId": null - }, - { - "id": "11ceb05f-8c94-46cd-9a7e-1c06be5a18b8", - "deviceAssetId": "015516300831.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/83/015516300831.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/11/ce/11ceb05f-8c94-46cd-9a7e-1c06be5a18b8-preview.jpeg", - "fileCreatedAt": "2014-05-03T14:44:20-07:00", - "fileModifiedAt": "2014-11-17T11:18:58-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/11/ce/11ceb05f-8c94-46cd-9a7e-1c06be5a18b8-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\x5b976715bab319b3bdc69d5f337701a062494e0b", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:55.048725-07:00", - "createdAt": "2024-04-25T10:14:12.923101-07:00", - "isArchived": false, - "originalFileName": "015516300831.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x5a08120c00771777f87778979877597fbef365", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2014-05-03T14:44:20-07:00", - "stackId": null - }, - { - "id": "e8e94a75-2b0c-48f6-b26a-76f5cbe46233", - "deviceAssetId": "985177500821.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/985177500821.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/e8/e9/e8e94a75-2b0c-48f6-b26a-76f5cbe46233-preview.jpeg", - "fileCreatedAt": "2004-04-28T20:31:40-07:00", - "fileModifiedAt": "2018-05-16T21:41:26.093-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/e8/e9/e8e94a75-2b0c-48f6-b26a-76f5cbe46233-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\x176b222fa88bc72aaf81031f3b7f73644b178de4", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:55.667409-07:00", - "createdAt": "2024-04-25T10:14:12.945414-07:00", - "isArchived": false, - "originalFileName": "985177500821.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\xdf07121d0687868f87378788887877887780670789", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2004-04-28T20:31:40-07:00", - "stackId": null - }, - { - "id": "4091bebd-4c26-4d30-bd3a-f2160a54b451", - "deviceAssetId": "956694610829.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/956694610829.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/40/91/4091bebd-4c26-4d30-bd3a-f2160a54b451-preview.jpeg", - "fileCreatedAt": "2010-07-05T09:10:13.2-07:00", - "fileModifiedAt": "2010-07-05T08:10:12-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/40/91/4091bebd-4c26-4d30-bd3a-f2160a54b451-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\xc2eb5667d6da5ead1be71c51064ea293ad413ea6", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:56.364375-07:00", - "createdAt": "2024-04-25T10:14:12.976197-07:00", - "isArchived": false, - "originalFileName": "956694610829.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x12080a0d82668886808887867877877867807906b7", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2010-07-05T09:10:13.2-07:00", - "stackId": null - }, - { - "id": "c7bf1944-9f71-4808-8ff9-b0f972e907b0", - "deviceAssetId": "948800300821.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/948800300821.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/c7/bf/c7bf1944-9f71-4808-8ff9-b0f972e907b0-preview.jpeg", - "fileCreatedAt": "2009-10-09T05:35:00.2-07:00", - "fileModifiedAt": "2009-10-09T04:35:00-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/c7/bf/c7bf1944-9f71-4808-8ff9-b0f972e907b0-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\x3c5c87ab7e442d1f7a0f2a12678c1d6be00dbc7b", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:56.553262-07:00", - "createdAt": "2024-04-25T10:14:12.982686-07:00", - "isArchived": false, - "originalFileName": "948800300821.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x103806258e02bd47937779a478997768fd3bcb9fa4", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2009-10-09T05:35:00.2-07:00", - "stackId": null - }, - { - "id": "4f5ea703-47e9-48c6-9366-0cc10630dac2", - "deviceAssetId": "898525300821.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/898525300821.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/4f/5e/4f5ea703-47e9-48c6-9366-0cc10630dac2-preview.jpeg", - "fileCreatedAt": "2020-12-25T08:35:04.92-07:00", - "fileModifiedAt": "2020-12-25T08:35:04-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/4f/5e/4f5ea703-47e9-48c6-9366-0cc10630dac2-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\xf706263e450c9a26feaeba2dd14fe0fd8f22e623", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:58.530848-07:00", - "createdAt": "2024-04-25T10:14:13.048275-07:00", - "isArchived": false, - "originalFileName": "898525300821.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x5518060d8208976849959a99687678687f8dae48f6", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2020-12-25T01:35:04.92-07:00", - "stackId": null - }, - { - "id": "86c813ad-2a1c-489f-8fc2-0b76a21889c0", - "deviceAssetId": "864710800829.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/864710800829.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/86/c8/86c813ad-2a1c-489f-8fc2-0b76a21889c0-preview.jpeg", - "fileCreatedAt": "2004-04-28T20:00:46-07:00", - "fileModifiedAt": "2004-04-28T19:00:46-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/86/c8/86c813ad-2a1c-489f-8fc2-0b76a21889c0-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\x9061edbf75f11526cef2c832ba339267509eaec4", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:59.171233-07:00", - "createdAt": "2024-04-25T10:14:13.078169-07:00", - "isArchived": false, - "originalFileName": "864710800829.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x140812250674874f87777669788778887a93a0470a", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2004-04-28T20:00:46-07:00", - "stackId": null - }, - { - "id": "b65121d8-4a74-4f27-9d6f-c582ffc444dc", - "deviceAssetId": "862274900829.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/862274900829.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/b6/51/b65121d8-4a74-4f27-9d6f-c582ffc444dc-preview.jpeg", - "fileCreatedAt": "2018-08-17T22:50:55.15-07:00", - "fileModifiedAt": "2022-11-03T20:25:09.161-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/b6/51/b65121d8-4a74-4f27-9d6f-c582ffc444dc-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\xd4f623e97acd727868fe0e191c170e449d4456a5", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:07:59.640678-07:00", - "createdAt": "2024-04-25T10:14:13.087927-07:00", - "isArchived": false, - "originalFileName": "862274900829.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x99180a0d045977a077687887777678876a806b0867", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2018-08-17T15:50:55.15-07:00", - "stackId": null - }, - { - "id": "09fa281c-b828-47f6-8fbb-a5856edb63b5", - "deviceAssetId": "840656100829.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/840656100829.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/09/fa/09fa281c-b828-47f6-8fbb-a5856edb63b5-preview.jpeg", - "fileCreatedAt": "2019-05-30T14:56:36.82-07:00", - "fileModifiedAt": "2019-05-30T14:56:36-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/09/fa/09fa281c-b828-47f6-8fbb-a5856edb63b5-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\xd215606441cefcc295130262bad9fed96d9ac40e", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:08:00.211274-07:00", - "createdAt": "2024-04-25T10:14:13.104556-07:00", - "isArchived": false, - "originalFileName": "840656100829.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\xd6070a0d826f62873c788799993a7777137f679058", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2019-05-30T07:56:36.82-07:00", - "stackId": null - }, - { - "id": "8c239624-2bea-479d-b7fa-9f2cd5ebc9b7", - "deviceAssetId": "812813100821.jpg", - "ownerId": "fc9fd5a1-d1b3-4080-a21c-daf9b1c24593", - "deviceId": "Library Import", - "type": "IMAGE", - "originalPath": "/var/snap/immich-distribution/pictures/82/812813100821.jpg", - "previewPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/8c/23/8c239624-2bea-479d-b7fa-9f2cd5ebc9b7-preview.jpeg", - "fileCreatedAt": "2021-08-28T16:29:07.65-07:00", - "fileModifiedAt": "2021-08-28T16:29:08-07:00", - "isFavorite": false, - "duration": null, - "thumbnailPath": "/var/snap/immich-distribution/common/upload/thumbs/fc9fd5a1-d1b3-4080-a21c-daf9b1c24593/8c/23/8c239624-2bea-479d-b7fa-9f2cd5ebc9b7-thumbnail.webp", - "encodedVideoPath": "", - "checksum": "\\x25a9ffe84298f0e3e7151aaf2eb339908574c035", - "isVisible": true, - "livePhotoVideoId": null, - "updatedAt": "2024-04-25T13:08:00.918411-07:00", - "createdAt": "2024-04-25T10:14:13.134038-07:00", - "isArchived": false, - "originalFileName": "812813100821.jpg", - "sidecarPath": null, - "isReadOnly": true, - "thumbhash": "\\x21080e0d825878767f9678bf7747799612c3b0308a", - "isOffline": false, - "libraryId": "af11ab7c-0782-4b7a-ba8e-fe68cf9a718d", - "isExternal": true, - "deletedAt": null, - "localDateTime": "2021-08-28T09:29:07.65-07:00", - "stackId": null - } + { + "EndLine": 116, + "FirstLine": "private Tuple\u003Cstring, Test[], JsonElement[], List\u003CFileInfo\u003E\u003E GetExtractResult(string reportFullPath, DateTime dateTime)", + "FirstUsedLine": 87, + "Name": "GetExtractResult", + "ParameterCount": 2, + "StartLine": 107 + }, + { + "EndLine": 478, + "FirstLine": "private void WriteFiles(string reportFullPath, DateTime dateTime)", + "FirstUsedLine": 112, + "Name": "WriteFiles", + "ParameterCount": 2, + "StartLine": 467 + }, + { + "EndLine": 195, + "FirstLine": "private static ReadOnlyCollection\u003CRecord\u003E GetKeyValuePairs(ReadOnlyDictionary\u003Cint, WorkItem\u003E keyValuePairs, WorkItem workItem, List\u003Cbool\u003E nests)", + "FirstUsedLine": 132, + "Name": "GetKeyValuePairs", + "ParameterCount": 3, + "StartLine": 159 + }, + { + "EndLine": 158, + "FirstLine": "private static int? GetIdFromUrlIfChild(Relation relation)", + "FirstUsedLine": 173, + "Name": "GetIdFromUrlIfChild", + "ParameterCount": 1, + "StartLine": 143 + }, + { + "EndLine": 271, + "FirstLine": "private static void AppendLines(List\u003Cchar\u003E spaces, List\u003Cstring\u003E lines, Record record, bool condensed, bool sprintOnly)", + "FirstUsedLine": 199, + "Name": "AppendLines", + "ParameterCount": 5, + "StartLine": 257 + }, + { + "EndLine": 246, + "FirstLine": "private static void AppendLines(string url, List\u003Cchar\u003E spaces, List\u003Cstring\u003E lines, ReadOnlyCollection\u003CRecord\u003E records, string workItemType)", + "FirstUsedLine": 217, + "Name": "AppendLines", + "ParameterCount": 5, + "StartLine": 199 + }, + { + "EndLine": 198, + "FirstLine": "private static string GetClosed(WorkItem workItem) =\u003E", + "FirstUsedLine": 250, + "Name": "GetClosed", + "ParameterCount": 1, + "StartLine": 196 + }, + { + "EndLine": 256, + "FirstLine": "private static string GetLine(List\u003Cchar\u003E spaces, WorkItem workItem, Record record, bool condensed, bool sprintOnly)", + "FirstUsedLine": 265, + "Name": "GetLine", + "ParameterCount": 5, + "StartLine": 247 + }, + { + "EndLine": 435, + "FirstLine": "private static void WriteFiles(string destinationDirectory, ReadOnlyCollection\u003Cstring\u003E lines, ReadOnlyCollection\u003CWorkItem\u003E workItems, string fileName)", + "FirstUsedLine": 272, + "Name": "WriteFiles", + "ParameterCount": 4, + "StartLine": 417 + }, + { + "EndLine": 445, + "FirstLine": "private static ReadOnlyDictionary\u003Cint, Record\u003E GetWorkItems(ReadOnlyCollection\u003CWorkItem\u003E workItems)", + "FirstUsedLine": 277, + "Name": "GetWorkItems", + "ParameterCount": 1, + "StartLine": 436 + }, + { + "EndLine": 457, + "FirstLine": "private static void WriteFileStructure(string destinationDirectory, ReadOnlyDictionary\u003Cint, Record\u003E keyValuePairs)", + "FirstUsedLine": 278, + "Name": "WriteFileStructure", + "ParameterCount": 2, + "StartLine": 446 + }, + { + "EndLine": 466, + "FirstLine": "private static void WriteFiles(string destinationDirectory, ReadOnlyCollection\u003CRecord\u003E records, string fileName)", + "FirstUsedLine": 284, + "Name": "WriteFiles", + "ParameterCount": 3, + "StartLine": 458 + }, + { + "EndLine": 335, + "FirstLine": "private static void WriteFiles(FileConnectorConfiguration fileConnectorConfiguration, string url, ReadOnlyCollection\u003Cstring\u003E workItemTypes, ReadOnlyCollection\u003CWorkItem\u003E workItems)", + "FirstUsedLine": 292, + "Name": "WriteFiles", + "ParameterCount": 4, + "StartLine": 272 + }, + { + "EndLine": 346, + "FirstLine": "private static void FilterChildren(ReadOnlyCollection\u003Cstring\u003E workItemTypes, Record record, List\u003CWorkItem\u003E results)", + "FirstUsedLine": 343, + "Name": "FilterChildren", + "ParameterCount": 3, + "StartLine": 336 + }, + { + "EndLine": 389, + "FirstLine": "private static ReadOnlyCollection\u003Cstring\u003E GetChildrenDirectories(ReadOnlyDictionary\u003Cint, Record\u003E keyValuePairs, List\u003Cbool\u003E nests, string parentDirectory, Record record)", + "FirstUsedLine": 384, + "Name": "GetChildrenDirectories", + "ParameterCount": 4, + "StartLine": 365 + }, + { + "EndLine": 142, + "FirstLine": "private static ReadOnlyDictionary\u003Cint, Record\u003E GetKeyValuePairs(ReadOnlyDictionary\u003Cint, WorkItem\u003E keyValuePairs)", + "FirstUsedLine": 442, + "Name": "GetKeyValuePairs", + "ParameterCount": 1, + "StartLine": 117 + }, + { + "EndLine": 416, + "FirstLine": "private static ReadOnlyCollection\u003Cstring\u003E GetDirectories(string destinationDirectory, ReadOnlyDictionary\u003Cint, Record\u003E keyValuePairs)", + "FirstUsedLine": 448, + "Name": "GetDirectories", + "ParameterCount": 2, + "StartLine": 390 + }, + { + "EndLine": 353, + "FirstLine": "private static ReadOnlyCollection\u003CWorkItem\u003E FilterChildren(ReadOnlyCollection\u003Cstring\u003E workItemTypes, Record record)", + "FirstUsedLine": 506, + "Name": "FilterChildren", + "ParameterCount": 2, + "StartLine": 347 + }, + { + "EndLine": 364, + "FirstLine": "private static int GetState(WorkItem workItem) =\u003E", + "FirstUsedLine": 628, + "Name": "GetState", + "ParameterCount": 1, + "StartLine": 354 + } ] \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 026990a..971ec9c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,7 +19,17 @@ "https://oi-metrology-viewer-prod.mes.infineon.com/json/work-items.json?v=2024-10-07-10-09&_=1728336047608", "Epic|Feature|User Story", "https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/", - "L:/DevOps/Mesa_FI/File-Folder-Helper/.vscode/helper/tfs" + "L:/DevOps/Mesa_FI/File-Folder-Helper/.vscode/helper/tfs", + "s", + "X", + "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG", + "Day-Helper-2024-01-08", + "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG/Adaptation/FileHandlers/Markdown", + "s", + "X", + "L:/DevOps/Mesa_FI/File-Folder-Helper", + "Day-Helper-2024-01-08", + "L:/DevOps/Mesa_FI/File-Folder-Helper/ADO2024/PI3" ], "cwd": "${workspaceFolder}", "console": "integratedTerminal", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3489de8..b30df40 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -132,11 +132,16 @@ "type": "shell", "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe", "args": [ + "s", + "X", + "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG", + "Day-Helper-2024-01-08", + "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG/Adaptation/FileHandlers/Markdown", "s", "X", "L:/DevOps/Mesa_FI/File-Folder-Helper", "Day-Helper-2024-01-08", - "L:/DevOps/Mesa_FI/File-Folder-Helper/Helpers" + "L:/DevOps/Mesa_FI/File-Folder-Helper/ADO2024/PI3" ], "problemMatcher": [] }, diff --git a/ADO2024/PI1/Helper-2024-01-08.cs b/ADO2024/PI1/Helper-2024-01-08.cs index dd0a9e5..21ee9c2 100644 --- a/ADO2024/PI1/Helper-2024-01-08.cs +++ b/ADO2024/PI1/Helper-2024-01-08.cs @@ -1,5 +1,7 @@ using Microsoft.Extensions.Logging; using System.Collections.ObjectModel; +using System.Text.Json; +using System.Text.Json.Serialization; using System.Text.RegularExpressions; namespace File_Folder_Helper.ADO2024.PI1; @@ -7,11 +9,18 @@ namespace File_Folder_Helper.ADO2024.PI1; internal static partial class Helper20240108 { - private record Method(string Name, + private record Method(int EndLine, + string FirstLine, + int FirstUsedLine, + string Name, int ParameterCount, - int StartLine, - int EndLine, - int FirstUsedLine); + int StartLine); + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(Method[]))] + private partial class MethodCollectionCommonSourceGenerationContext : JsonSerializerContext + { + } [GeneratedRegex(@"(?[A-Z]{1}[A-Za-z_0-9]*)\(")] private static partial Regex CSharpMethodName(); @@ -40,7 +49,7 @@ internal static partial class Helper20240108 for (int j = i - 1; j > -1; j--) { line = lines[j].Trim(); - if (!line.StartsWith('[') && !line.StartsWith("/// ")) + if (!line.StartsWith('[') && !line.StartsWith('#') && !line.StartsWith("/// ")) break; result--; } @@ -155,7 +164,9 @@ internal static partial class Helper20240108 string line; string? name; int startLine; + Method method; string search; + string firstLine; string innerLine; string searchNot; string searchWrap; @@ -186,12 +197,18 @@ internal static partial class Helper20240108 startLine = GetStartLine(lines, i); searchConstructor = $"{name.ToLower()} = new("; parameterCount = GetParameterCount(line, search); - isLinq = lines[i + 1].Trim() != "{"; + if (!lines[startLine].StartsWith("#pragma")) + firstLine = lines[startLine].Trim(); + else + firstLine = lines[startLine + 1].Trim(); + isLinq = !lines[i + 1].StartsWith("#pragma") && lines[i + 1].Trim() != "{"; if (isLinq) blocks++; for (int j = i + 1; j < lines.Length; j++) { innerLine = lines[j].Trim(); + if (innerLine.StartsWith("#pragma")) + continue; if (isLinq && string.IsNullOrEmpty(innerLine)) { if (line.EndsWith(';')) @@ -218,7 +235,8 @@ internal static partial class Helper20240108 } if (j > lines.Length - 2) throw new Exception(); - results.Add(new(name, parameterCount, startLine, endLine, firstUsedLine.Value)); + method = new(endLine, firstLine, firstUsedLine.Value, name, parameterCount, startLine); + results.Add(method); break; } } @@ -230,6 +248,8 @@ internal static partial class Helper20240108 { bool result; List results = []; + if (methods.Count == 0) + File.WriteAllText(".vscode/.json", JsonSerializer.Serialize(methods.ToArray(), MethodCollectionCommonSourceGenerationContext.Default.MethodArray)); ReadOnlyCollection methodLines = GetMethodLines(methods); int minMethodLines = methodLines.Min(); for (int i = 0; i < minMethodLines; i++) diff --git a/ADO2024/PI3/Helper-2024-09-11.cs b/ADO2024/PI3/Helper-2024-09-11.cs index 64a91c1..3a84c48 100644 --- a/ADO2024/PI3/Helper-2024-09-11.cs +++ b/ADO2024/PI3/Helper-2024-09-11.cs @@ -7,48 +7,40 @@ namespace File_Folder_Helper.ADO2024.PI3; internal static partial class Helper20240911 { - public record Attribute([property: JsonPropertyName("isLocked")] bool IsLocked, - [property: JsonPropertyName("name")] string Name); + private record Attribute([property: JsonPropertyName("isLocked")] bool IsLocked, + [property: JsonPropertyName("name")] string Name); - public record Relation([property: JsonPropertyName("rel")] string Type, - [property: JsonPropertyName("url")] string URL, - [property: JsonPropertyName("attributes")] Attribute Attributes); + private record Relation([property: JsonPropertyName("rel")] string Type, + [property: JsonPropertyName("url")] string URL, + [property: JsonPropertyName("attributes")] Attribute Attributes); - public record Record(WorkItem WorkItem, WorkItem? Parent, ReadOnlyCollection Children); - - [JsonSourceGenerationOptions(WriteIndented = true)] - [JsonSerializable(typeof(Record[]))] - internal partial class RecordCollectionCommonSourceGenerationContext : JsonSerializerContext - { - } - - public record WorkItem(string AreaPath, - string? AssignedTo, - int? BusinessValue, - DateTime ChangedDate, - DateTime? ClosedDate, - int CommentCount, - DateTime CreatedDate, - string Description, - float? Effort, - int Id, - string IterationPath, - int? Parent, - int? Priority, - Relation[] Relations, - string? Requester, - DateTime? ResolvedDate, - int Revision, - int? RiskReductionMinusOpportunityEnablement, - DateTime? StartDate, - string State, - string Tags, - DateTime? TargetDate, - float? TimeCriticality, - string Title, - string? Violation, - float? WeightedShortestJobFirst, - string WorkItemType) + private record WorkItem(string AreaPath, + string? AssignedTo, + int? BusinessValue, + DateTime ChangedDate, + DateTime? ClosedDate, + int CommentCount, + DateTime CreatedDate, + string Description, + float? Effort, + int Id, + string IterationPath, + int? Parent, + int? Priority, + Relation[] Relations, + string? Requester, + DateTime? ResolvedDate, + int Revision, + int? RiskReductionMinusOpportunityEnablement, + DateTime? StartDate, + string State, + string Tags, + DateTime? TargetDate, + float? TimeCriticality, + string Title, + string? Violation, + float? WeightedShortestJobFirst, + string WorkItemType) { public override string ToString() => $"{Id} - {WorkItemType} - {Title}"; @@ -86,7 +78,17 @@ internal static partial class Helper20240911 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(WorkItem[]))] - internal partial class WorkItemSourceGenerationContext : JsonSerializerContext + private partial class WorkItemSourceGenerationContext : JsonSerializerContext + { + } + + private record Record(WorkItem WorkItem, + WorkItem? Parent, + ReadOnlyCollection Children); + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(Record[]))] + private partial class RecordCollectionCommonSourceGenerationContext : JsonSerializerContext { } @@ -110,6 +112,7 @@ internal static partial class Helper20240911 { List results = []; int? childId; + Record record; nests.Add(true); WorkItem? childWorkItem; WorkItem? parentWorkItem; @@ -128,16 +131,17 @@ internal static partial class Helper20240911 collection.Add(childWorkItem); } collection = (from l in collection orderby l.State != "Closed", l.Id select l).ToList(); - foreach (WorkItem item in collection) + foreach (WorkItem w in collection) { if (nests.Count > 99) break; - if (item.Parent is null) + if (w.Parent is null) parentWorkItem = null; else - _ = keyValuePairs.TryGetValue(item.Parent.Value, out parentWorkItem); - records = GetKeyValuePairs(keyValuePairs, item, nests); - results.Add(new(item, parentWorkItem, records)); + _ = keyValuePairs.TryGetValue(w.Parent.Value, out parentWorkItem); + records = GetKeyValuePairs(keyValuePairs, w, nests); + record = new(w, parentWorkItem, records); + results.Add(record); } } return new(results); @@ -219,90 +223,46 @@ internal static partial class Helper20240911 return result; } - private static ReadOnlyCollection GetWorkItemsNotMatching(string tags, ReadOnlyCollection workItems) - { - List results = []; - string[] segments; - string[] parentTags = tags.Split(';'); - foreach (WorkItem workItem in workItems) - { - segments = tags.Split(';'); - if (segments.Length > 0 && parentTags.Any(l => segments.Contains(l))) - continue; - results.Add(workItem); - } - return new(results); - } - - private static ReadOnlyCollection GetWorkItemsNotMatching(int? priority, ReadOnlyCollection workItems) - { - List results = []; - foreach (WorkItem workItem in workItems) - { - if (workItem.Priority == priority) - continue; - results.Add(workItem); - } - return new(results); - } - - private static int GetState(WorkItem workItem) => - workItem.State switch - { - "New" => 1, - "Active" => 2, - "Resolved" => 3, - "Closed" => 4, - "Removed" => 5, - _ => 8 - }; - - private static ReadOnlyCollection GetWorkItemsNotMatching(Record record, ReadOnlyCollection workItems) - { - List results = []; - int check; - int state = GetState(record.WorkItem); - List> collection = []; - foreach (WorkItem workItem in workItems) - { - check = GetState(workItem); - if (check == state) - continue; - collection.Add(new(check, workItem)); - } - foreach (KeyValuePair keyValuePair in collection.OrderByDescending(l => l.Key)) - results.Add(keyValuePair.Value); - return new(results); - } - - private static ReadOnlyCollection GetChildrenDirectories(ReadOnlyDictionary keyValuePairs, List nests, string parentDirectory, ReadOnlyCollection children) + private static ReadOnlyCollection GetChildrenDirectories(ReadOnlyDictionary keyValuePairs, List nests, string parentDirectory, Record record) { List results = []; nests.Add(true); string directory; Record? childRecord; ReadOnlyCollection childrenDirectories; - foreach (Record record in children) + foreach (Record r in record.Children) { // if (record.WorkItem.Id == 110730) // continue; // if (record.WorkItem.Id == 110732) // continue; - directory = Path.Combine(parentDirectory, $"{record.WorkItem.WorkItemType[..1]}-{record.WorkItem.Id}-{record.WorkItem.Title.Trim()[..1]}"); + directory = Path.Combine(parentDirectory, $"{r.WorkItem.WorkItemType[..1]}-{r.WorkItem.Id}-{r.WorkItem.Title.Trim()[..1]}"); results.Add(directory); - if (!keyValuePairs.TryGetValue(record.WorkItem.Id, out childRecord)) + if (!keyValuePairs.TryGetValue(r.WorkItem.Id, out childRecord)) continue; if (nests.Count > 99) break; - childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, childRecord.Children); + childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, childRecord); results.AddRange(childrenDirectories); } return new(results); } + private static void FilterChildren(ReadOnlyCollection workItemTypes, Record record, List results) + { + foreach (Record r in record.Children) + { + if (!workItemTypes.Contains(r.WorkItem.WorkItemType)) + continue; + results.Add(r.WorkItem); + FilterChildren(workItemTypes, r, results); + } + } + private static ReadOnlyDictionary GetKeyValuePairs(ReadOnlyDictionary keyValuePairs) { Dictionary results = []; + Record record; List nests = []; WorkItem? parentWorkItem; ReadOnlyCollection records; @@ -316,12 +276,13 @@ internal static partial class Helper20240911 try { records = GetKeyValuePairs(keyValuePairs, keyValuePair.Value, nests); - results.Add(keyValuePair.Key, new(keyValuePair.Value, parentWorkItem, records)); + record = new(keyValuePair.Value, parentWorkItem, records); } catch (Exception) { - results.Add(keyValuePair.Key, new(keyValuePair.Value, parentWorkItem, new([]))); + record = new(keyValuePair.Value, parentWorkItem, new([])); } + results.Add(keyValuePair.Key, record); } return new(results); } @@ -347,40 +308,30 @@ internal static partial class Helper20240911 // continue; nests.Clear(); directory = Path.Combine(ticksDirectory, $"{record.WorkItem.WorkItemType[..1]}-{record.WorkItem.Id}-{record.WorkItem.Title.Trim()[..1]}"); - childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, record.Children); + childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, record); results.AddRange(childrenDirectories); } return new(results.Distinct().ToArray()); } - private static ReadOnlyCollection FilterChildren(Record record, ReadOnlyCollection workItemTypes) + private static int GetState(WorkItem workItem) => + workItem.State switch + { + "New" => 1, + "Active" => 2, + "Resolved" => 3, + "Closed" => 4, + "Removed" => 5, + _ => 8 + }; + + private static ReadOnlyCollection FilterChildren(ReadOnlyCollection workItemTypes, Record record) { List results = []; - WorkItem workItem; - foreach (Record child in record.Children) - { - workItem = child.WorkItem; - if (!workItemTypes.Contains(workItem.WorkItemType)) - continue; - results.Add(workItem); - } + FilterChildren(workItemTypes, record, results); return new(results); } - private static string? GetMaxIterationPath(ReadOnlyCollection workItems) - { - string? result; - List results = []; - foreach (WorkItem workItem in workItems) - { - if (results.Contains(workItem.IterationPath)) - continue; - results.Add(workItem.IterationPath); - } - result = results.Count == 0 ? null : results.Max(); - return result; - } - private static ReadOnlyDictionary GetWorkItems(ILogger logger, string developmentURL, string productionURL) { ReadOnlyDictionary results; @@ -393,15 +344,18 @@ internal static partial class Helper20240911 logger.LogWarning("{StatusCode} for {url}", httpResponseMessage.Result.StatusCode, developmentURL); Task developmentJSON = httpResponseMessage.Result.Content.ReadAsStringAsync(); developmentJSON.Wait(); - httpResponseMessage = httpClient.GetAsync(productionURL); - httpResponseMessage.Wait(); - if (!httpResponseMessage.Result.IsSuccessStatusCode) - logger.LogWarning("{StatusCode} for {url}", httpResponseMessage.Result.StatusCode, productionURL); - Task productionJSON = httpResponseMessage.Result.Content.ReadAsStringAsync(); - productionJSON.Wait(); - if (developmentJSON.Result != developmentJSON.Result) - logger.LogWarning("developmentJSON doesn't match developmentJSON"); - WorkItem[]? workItems = JsonSerializer.Deserialize(productionJSON.Result, WorkItemSourceGenerationContext.Default.WorkItemArray); + if (!string.IsNullOrEmpty(productionURL)) + { + httpResponseMessage = httpClient.GetAsync(productionURL); + httpResponseMessage.Wait(); + if (!httpResponseMessage.Result.IsSuccessStatusCode) + logger.LogWarning("{StatusCode} for {url}", httpResponseMessage.Result.StatusCode, productionURL); + Task productionJSON = httpResponseMessage.Result.Content.ReadAsStringAsync(); + productionJSON.Wait(); + if (productionJSON.Result != developmentJSON.Result) + logger.LogWarning("productionJSON doesn't match developmentJSON"); + } + WorkItem[]? workItems = JsonSerializer.Deserialize(developmentJSON.Result, WorkItemSourceGenerationContext.Default.WorkItemArray); if (workItems is null) logger.LogWarning("workItems is null"); else @@ -453,6 +407,108 @@ internal static partial class Helper20240911 File.WriteAllText(jsonFile, json); } + private static ReadOnlyCollection GetWorkItemsNotMatching122514(Record record, ReadOnlyCollection workItems) + { + List results = []; + string[] segments; + string[] parentTags = record.WorkItem.Tags.Split(';').Select(l => l.Trim()).ToArray(); + foreach (WorkItem workItem in workItems) + { + segments = string.IsNullOrEmpty(workItem.Tags) ? [] : workItem.Tags.Split(';').Select(l => l.Trim()).ToArray(); + if (segments.Length > 0 && parentTags.Any(l => segments.Contains(l))) + continue; + results.Add(workItem); + } + return new(results); + } + + private static ReadOnlyCollection GetWorkItemsNotMatching126169(Record record, ReadOnlyCollection workItems) + { + List results = []; + foreach (WorkItem workItem in workItems) + { + if (record.WorkItem.Priority is null) + { + results.Add(record.WorkItem); + break; + } + if (workItem.Priority == record.WorkItem.Priority.Value) + continue; + results.Add(workItem); + } + return new(results); + } + + private static ReadOnlyCollection GetWorkItemsNotMatching123066(Record record, ReadOnlyCollection workItems) + { + List results = []; + int check; + int state = GetState(record.WorkItem); + List> collection = []; + foreach (WorkItem workItem in workItems) + { + if (workItem.State is "Removed") + continue; + check = GetState(workItem); + if (check == state) + continue; + collection.Add(new(check, workItem)); + } + if (collection.Count > 0) + { + KeyValuePair[] notNewState = (from l in collection where l.Value.State != "New" select l).ToArray(); + if (notNewState.Length == 0 && record.WorkItem.State is "New" or "Active") + collection.Clear(); + else if (notNewState.Length > 0) + { + int minimum = notNewState.Min(l => l.Key); + if (minimum == state) + collection.Clear(); + else if (minimum == 1 && record.WorkItem.State == "New") + collection.Clear(); + else if (notNewState.Length > 0 && record.WorkItem.State == "Active") + collection.Clear(); + } + } + foreach (KeyValuePair keyValuePair in collection.OrderByDescending(l => l.Key)) + results.Add(keyValuePair.Value); + return new(results); + } + + private static ReadOnlyCollection GetWorkItemsNotMatching123067(Record record, ReadOnlyCollection workItems) + { + List results = []; + int check; + int state = GetState(record.WorkItem); + List> collection = []; + foreach (WorkItem workItem in workItems) + { + if (record.WorkItem.State is "Removed" or "Resolved" or "Closed") + continue; + check = GetState(workItem); + if (check == state) + continue; + collection.Add(new(check, workItem)); + } + foreach (KeyValuePair keyValuePair in collection.OrderByDescending(l => l.Key)) + results.Add(keyValuePair.Value); + return new(results); + } + + private static string? GetMaxIterationPath122508(ReadOnlyCollection workItems) + { + string? result; + List results = []; + foreach (WorkItem workItem in workItems) + { + if (results.Contains(workItem.IterationPath)) + continue; + results.Add(workItem.IterationPath); + } + result = results.Count == 0 ? null : results.Max(); + return result; + } + private static ReadOnlyCollection FeatureCheckIterationPath122508(string url, List lines, ReadOnlyCollection workItemTypes, ReadOnlyCollection records, string workItemType) { List results = []; @@ -462,14 +518,16 @@ internal static partial class Helper20240911 ReadOnlyCollection childrenWorkItems; foreach (Record record in records) { + if (record.WorkItem.State is "Removed") + continue; if (record.WorkItem.WorkItemType != workItemType) continue; collection.Clear(); violations.Clear(); if (record.Children.Count == 0) continue; - childrenWorkItems = FilterChildren(record, workItemTypes); - maxIterationPath = GetMaxIterationPath(childrenWorkItems); + childrenWorkItems = FilterChildren(workItemTypes, record); + maxIterationPath = GetMaxIterationPath122508(childrenWorkItems); if (string.IsNullOrEmpty(maxIterationPath) || record.WorkItem.IterationPath == maxIterationPath) continue; collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}"); @@ -478,7 +536,7 @@ internal static partial class Helper20240911 collection.Add($"- [ ] {record.WorkItem.Id} => {record.WorkItem.IterationPath} != {maxIterationPath}"); collection.Add(string.Empty); lines.AddRange(collection); - results.Add(WorkItem.Get(record.WorkItem, $"IterationPath:{record.WorkItem.Id};{record.WorkItem.IterationPath} != {maxIterationPath}")); + results.Add(WorkItem.Get(record.WorkItem, $"IterationPath:{record.WorkItem.Id};{record.WorkItem.IterationPath} != {maxIterationPath}")); } return new(results); } @@ -492,6 +550,8 @@ internal static partial class Helper20240911 ReadOnlyCollection workItemsNotMatching; foreach (Record record in records) { + if (record.WorkItem.State is "Removed") + continue; if (record.WorkItem.WorkItemType != workItemType) continue; collection.Clear(); @@ -502,8 +562,8 @@ internal static partial class Helper20240911 workItemsNotMatching = new([record.WorkItem]); else { - childrenWorkItems = FilterChildren(record, workItemTypes); - workItemsNotMatching = GetWorkItemsNotMatching(record.WorkItem.Tags, childrenWorkItems); + childrenWorkItems = FilterChildren(workItemTypes, record); + workItemsNotMatching = GetWorkItemsNotMatching122514(record, childrenWorkItems); if (!string.IsNullOrEmpty(record.WorkItem.Tags) && workItemsNotMatching.Count == 0) continue; } @@ -516,7 +576,7 @@ internal static partial class Helper20240911 lines.AddRange(collection); violations.Add($"Tag:{record.WorkItem.Tags};"); foreach (WorkItem workItem in workItemsNotMatching) - violations.Add($"{workItem.Id}:{workItem.Tags};"); + violations.Add($"{workItem.Id}:{workItem.Tags};"); results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations))); } return new(results); @@ -531,14 +591,16 @@ internal static partial class Helper20240911 ReadOnlyCollection workItemsNotMatching; foreach (Record record in records) { + if (record.WorkItem.State is "Removed") + continue; if (record.WorkItem.WorkItemType != workItemType) continue; collection.Clear(); violations.Clear(); if (record.Children.Count == 0) continue; - childrenWorkItems = FilterChildren(record, workItemTypes); - workItemsNotMatching = GetWorkItemsNotMatching(record.WorkItem.Priority, childrenWorkItems); + childrenWorkItems = FilterChildren(workItemTypes, record); + workItemsNotMatching = GetWorkItemsNotMatching126169(record, childrenWorkItems); if (workItemsNotMatching.Count == 0) continue; collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}"); @@ -550,7 +612,7 @@ internal static partial class Helper20240911 lines.AddRange(collection); violations.Add($"Priority:{record.WorkItem.Priority};"); foreach (WorkItem workItem in workItemsNotMatching) - violations.Add($"{workItem.Id}:{workItem.Priority};"); + violations.Add($"{workItem.Id}:{workItem.Priority};"); results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations))); } return new(results); @@ -565,16 +627,16 @@ internal static partial class Helper20240911 ReadOnlyCollection workItemsNotMatching; foreach (Record record in records) { + if (record.WorkItem.State is "Removed") + continue; if (record.WorkItem.WorkItemType != workItemType) continue; collection.Clear(); violations.Clear(); - if (record.WorkItem.State == "New") - continue; if (record.Children.Count == 0) continue; - childrenWorkItems = FilterChildren(record, workItemTypes); - workItemsNotMatching = GetWorkItemsNotMatching(record, childrenWorkItems); + childrenWorkItems = FilterChildren(workItemTypes, record); + workItemsNotMatching = GetWorkItemsNotMatching123066(record, childrenWorkItems); if (workItemsNotMatching.Count == 0) continue; collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}"); @@ -586,7 +648,7 @@ internal static partial class Helper20240911 lines.AddRange(collection); violations.Add($"State:{record.WorkItem.State};"); foreach (WorkItem workItem in workItemsNotMatching) - violations.Add($"{workItem.Id}:{workItem.State};"); + violations.Add($"{workItem.Id}:{workItem.State};"); results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations))); } return new(results); @@ -601,14 +663,16 @@ internal static partial class Helper20240911 ReadOnlyCollection workItemsNotMatching; foreach (Record record in records) { + if (record.WorkItem.State is "Removed" or "New" or "Active") + continue; if (record.WorkItem.WorkItemType != workItemType) continue; collection.Clear(); violations.Clear(); if (record.Children.Count == 0) continue; - childrenWorkItems = FilterChildren(record, workItemTypes); - workItemsNotMatching = GetWorkItemsNotMatching(record, childrenWorkItems); + childrenWorkItems = FilterChildren(workItemTypes, record); + workItemsNotMatching = GetWorkItemsNotMatching123067(record, childrenWorkItems); if (workItemsNotMatching.Count == 0) continue; collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}"); @@ -620,7 +684,7 @@ internal static partial class Helper20240911 lines.AddRange(collection); violations.Add($"State:{record.WorkItem.State};"); foreach (WorkItem workItem in workItemsNotMatching) - violations.Add($"{workItem.Id}:{workItem.State};"); + violations.Add($"{workItem.Id}:{workItem.State};"); results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations))); } return new(results); diff --git a/File-Folder-Helper.csproj b/File-Folder-Helper.csproj index 2b7c7a9..cc4ba9b 100644 --- a/File-Folder-Helper.csproj +++ b/File-Folder-Helper.csproj @@ -15,13 +15,13 @@ - - + + - - + + - + \ No newline at end of file