Class AchievementSdkInspector
Compares what a storefront SDK requires against what the project actually has: is the SDK compiled in, and is its scripting define set.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor.Platforms
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementSdkInspector
Remarks
Takes both answers as functions instead of reading the project, so every state is assertable without an SDK, a build target or an editor — which matters more here than anywhere else, because none of the four SDKs will ever be installed in this repository and the states that only appear when one IS installed would otherwise be untestable.
Whoever calls it supplies the two lookups; that supply is the part that cannot be tested cheaply, and keeping it out of here is what leaves the rules testable.
Methods
Inspect(AchievementSdkManifest, Func<string, bool>, Func<string, bool>)
Measures one storefront's SDK against its manifest.
Declaration
public static AchievementSdkInstallationReport Inspect(AchievementSdkManifest manifest, Func<string, bool> typeExists, Func<string, bool> isScriptingDefineSet)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSdkManifest | manifest | What the storefront requires. |
| Func<string, bool> | typeExists | Answers whether a full type name resolves in this project. |
| Func<string, bool> | isScriptingDefineSet | Answers whether a define is set for the build target being inspected. |
Returns
| Type | Description |
|---|---|
| AchievementSdkInstallationReport | The report. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when a required argument is |
InspectAll(Func<string, bool>, Func<string, bool>)
Measures every shipped manifest against the same project.
Declaration
public static IReadOnlyList<AchievementSdkInstallationReport> InspectAll(Func<string, bool> typeExists, Func<string, bool> isScriptingDefineSet)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<string, bool> | typeExists | Answers whether a full type name resolves in this project. |
| Func<string, bool> | isScriptingDefineSet | Answers whether a define is set for the build target being inspected. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementSdkInstallationReport> | One report per shipped storefront, in manifest order. |
Remarks
One storefront that cannot be measured costs only itself. The lookups reach into whatever the project loaded — a half-loaded assembly, a broken package — and a throw from any of them would otherwise leave the window with no reports at all, hiding three healthy storefronts behind one broken question.