Assert.That(choice.Provider.Id,Is.EqualTo(ASSISTANT_PROVIDER_ID),"With nothing configured for the cleaner, it has to use the model of the assistant around it.");
Assert.That(choice.Provider.Id,Is.EqualTo(APP_DEFAULT_PROVIDER_ID),"Without an assistant model, the app-wide default is what is left before giving up.");
Assert.That(choice.Provider.Id,Is.EqualTo(CLEANER_PROVIDER_ID),"A model picked for the cleaner is the whole point of picking one, so it outranks the assistant's.");
}
/// <summary>
/// Checks that the switch above the cleaner's provider field really turns that provider off.
/// </summary>
/// <remarks>
/// The provider id stays in the settings when the switch goes off, so the only thing saying it
/// must not be used is this one flag. Settings which hand out the stored id instead of asking the
/// flag would keep using a provider the user switched away from.
Assert.That(choice.Provider.Id,Is.EqualTo(ASSISTANT_PROVIDER_ID),"With its preselection switched off, the cleaner has to fall back to the assistant's model.");
}
/// <summary>
/// Checks that a model too untrusted for the cleaner is not used just because it is there.
/// </summary>
/// <remarks>
/// This is the case the user meets as a hint next to the cleaner switch: a model is selected in
/// the assistant, and the cleaner still has none. Under TRUST_ALL every provider reaches MEDIUM
/// and a self-hosted one reaches HIGH, so a minimum of HIGH separates the two.
Assert.That(choice.HasProvider,Is.False,"A provider the organization ruled out must not reach the cleaner through the assistant.");
Assert.That(choice.FallbackIssue,Is.EqualTo(AIOperationProviderIssue.BELOW_MINIMUM_CONFIDENCE),"The hint next to the switch tells this reason from a missing model.");
Assert.That(choice.Provider.Id,Is.EqualTo(ASSISTANT_PROVIDER_ID),"A provider which clears the bar has to be handed over, or the hint would never go away.");
}
/// <summary>
/// Checks that the minimum of the cleaner itself applies to the model of the assistant as well.
/// </summary>
/// <remarks>
/// Whether a model may read the page is decided by what the cleaner requires, not by what the model was
/// picked for. Otherwise a model ruled out for the cleaner would clean the page anyway.