public async Task SetApplicationManifestKind(string newValue, string?currentApplicationManifestPropertyValue, string?currentNoManifestPropertyValue, string?expectedAppManifestPropertyValue, string?expectedNoManifestPropertyValue, string?expectedStoredValue) { Dictionary <string, string> storageDictionary = new(); var storage = ITemporaryPropertyStorageFactory.Create(storageDictionary); Dictionary <string, string?> defaultPropertiesDictionary = new(); defaultPropertiesDictionary["ApplicationManifest"] = currentApplicationManifestPropertyValue; defaultPropertiesDictionary["NoWin32Manifest"] = currentNoManifestPropertyValue; var defaultProperties = IProjectPropertiesFactory.CreateWithPropertiesAndValues(defaultPropertiesDictionary); var provider = new ApplicationManifestKindValueProvider(storage); await provider.OnSetPropertyValueAsync("", newValue, defaultProperties); defaultPropertiesDictionary.TryGetValue("ApplicationManifest", out string?finalAppManifestPropertyValue); defaultPropertiesDictionary.TryGetValue("NoWin32Manifest", out string?finalNoManifestPropertyValue); storageDictionary.TryGetValue("ApplicationManifestKind", out string?finalStoredValue); Assert.Equal(expectedAppManifestPropertyValue, finalAppManifestPropertyValue); Assert.Equal(expectedNoManifestPropertyValue, finalNoManifestPropertyValue); Assert.Equal(expectedStoredValue, finalStoredValue); }
public async Task GetApplicationManifestKind(string applicationManifestPropertyValue, string noManifestPropertyValue, string?storedValue, string expectedValue) { Dictionary <string, string>?storedValues = null; if (storedValue is not null) { storedValues = new Dictionary <string, string> { { "ApplicationManifestKind", storedValue } }; } var storage = ITemporaryPropertyStorageFactory.Create(storedValues); var provider = new ApplicationManifestKindValueProvider(storage); var defaultProperties = IProjectPropertiesFactory.CreateWithPropertiesAndValues(new Dictionary <string, string?> { { "ApplicationManifest", applicationManifestPropertyValue }, { "NoWin32Manifest", noManifestPropertyValue } }); var kindValue = await provider.OnGetEvaluatedPropertyValueAsync(string.Empty, string.Empty, defaultProperties); Assert.Equal(expected: expectedValue, actual: kindValue); }