Assert.That(_sdAddInManagement.RemovedExternalAddIns,Contains.Item(_addIn1),"AddIn must have been removed from external AddIns list.");
Assert.That(_sdAddInManagement.AddInsMarkedForRemoval,Contains.Item(_addIn1.Manifest.PrimaryIdentity),"AddIn must have been marked for removal on next startup.");
Assert.That(addInUninstalledEventReceived,"AddInUninstalled event sent with correct AddIn");
// Cancel the uninstallation
_addInSetup.CancelUninstallation(_addIn1);
// Check if uninstallation has been reverted
Assert.That(_sdAddInManagement.AddInsMarkedForRemoval.Contains(_addIn1.Manifest.PrimaryIdentity),Is.False,"AddIn must not be marked for removal any more.");
}
[Test, Description("AddIn installed from a NuGet package must be uninstalled.")]
publicvoidUninstallValidNuGetAddIn()
{
CreateAddIns();
// Create a fake package
FakePackagefakePackage=newFakePackage()
{
Id=_addIn1.Manifest.PrimaryIdentity,
Version=newSemanticVersion(_addIn1.Version)
};
// Prepare all (fake) services needed for AddInSetup and its instance, itself