Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions Docs/ASLM/content/docs/ASLM/Services/UpdateManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,46 @@ Saves one module manifest after update preferences changed in UI.

---

#### `private static bool IsModuleAlreadyAtInstallTarget(ModuleConfig module, UpdateCandidate candidate)`
#### `internal static bool HasRecordedRemoteSourceInstall(ModuleConfig module)`

**Purpose:** ---
**Purpose:** Returns whether the module manifest records a successful remote source install.

**Parameters:**

- `module`: The `ModuleConfig` to check.

**Returns:** `true` if a remote source install is recorded; otherwise, `false`.

**Example:**

```csharp
bool hasInstall = UpdateManager.HasRecordedRemoteSourceInstall(module);
```

---

#### `internal static bool ShouldOfferReleaseInstallCandidate(ModuleConfig module, string resolvedReleaseTag)`

**Purpose:** Returns whether a resolved release install candidate should be offered for download.

**Parameters:**

- `module`: The `ModuleConfig` to evaluate.
- `resolvedReleaseTag`: The resolved release tag.

**Returns:** `true` if the candidate should be offered; otherwise, `false`.

**Example:**

```csharp
bool shouldOffer = UpdateManager.ShouldOfferReleaseInstallCandidate(module, "0.7.1.8");
```

---

#### `internal static bool IsModuleAlreadyAtInstallTarget(ModuleConfig module, UpdateCandidate candidate)`

**Purpose:** Returns whether the install candidate already matches the local installation (no file work needed).

#### `private static string ResolveCurrentAppDisplayVersion()`

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: "UpdateManagerInstallStateTests"
draft: false
---

## Class `UpdateManagerInstallStateTests`

`ASLM/Tests/Services/UpdateManagerInstallStateTests.cs` — tests `HasRecordedRemoteSourceInstall`, `ShouldOfferReleaseInstallCandidate`, and `IsModuleAlreadyAtInstallTarget` in [UpdateManager](../../Services/UpdateManager/) to verify update installation state checks.

---

## Test methods

#### `public void HasRecordedRemoteSourceInstall_returns_false_for_release_module_without_installed_tag()`

**Purpose:** Verifies that a release-tracked module without a recorded installed tag correctly returns false.

---

#### `public void HasRecordedRemoteSourceInstall_returns_true_when_installed_release_tag_is_set()`

**Purpose:** Verifies that a release-tracked module with a recorded installed tag correctly returns true.

---

#### `public void HasRecordedRemoteSourceInstall_returns_false_for_branch_module_without_commit_sha()`

**Purpose:** Verifies that a branch-tracked module without a recorded installed commit SHA correctly returns false.

---

#### `public void HasRecordedRemoteSourceInstall_returns_true_when_installed_commit_sha_is_set()`

**Purpose:** Verifies that a branch-tracked module with a recorded installed commit SHA correctly returns true.

---

#### `public void ShouldOfferReleaseInstallCandidate_returns_true_when_version_matches_but_source_not_recorded()`

**Purpose:** Verifies that an installation candidate should be offered if no remote source is recorded, even if the version matches.

---

#### `public void ShouldOfferReleaseInstallCandidate_returns_false_when_installed_release_tag_matches()`

**Purpose:** Verifies that an installation candidate should not be offered when the local installed release tag perfectly matches the candidate.

---

#### `public void ShouldOfferReleaseInstallCandidate_returns_true_when_installed_release_tag_differs()`

**Purpose:** Verifies that an installation candidate should be offered when the local installed release tag differs from the candidate.

---

#### `public void IsModuleAlreadyAtInstallTarget_returns_false_when_release_matches_but_source_not_recorded()`

**Purpose:** Verifies that `IsModuleAlreadyAtInstallTarget` correctly returns false when the release matches but the source install isn't explicitly recorded.

---

#### `public void IsModuleAlreadyAtInstallTarget_returns_true_when_installed_release_tag_matches_candidate()`

**Purpose:** Verifies that `IsModuleAlreadyAtInstallTarget` returns true when the installed release tag matches the update candidate.

---

#### `public void IsModuleAlreadyAtInstallTarget_returns_false_for_branch_when_installed_commit_sha_missing()`

**Purpose:** Verifies that `IsModuleAlreadyAtInstallTarget` correctly returns false for a branch-tracked candidate when the installed commit SHA is missing.

---

## Related

- [UpdateManager](../../Services/UpdateManager/)
Loading