This commit is contained in:
Ivan Matkov 2022-08-12 15:31:43 +02:00
Родитель 0971157af8
Коммит 838f7f5288
3 изменённых файлов: 3 добавлений и 36 удалений

Просмотреть файл

@ -187,7 +187,7 @@ namespace Microsoft.AppCenter.Utils
protected override string GetAppBuild()
{
return DeploymentVersion ?? AssemblyVersion.FileVersion ?? _defaultVersion;
return DeploymentVersion ?? AssemblyVersion?.FileVersion ?? _defaultVersion;
}
protected override string GetScreenSize()
@ -207,7 +207,7 @@ namespace Microsoft.AppCenter.Utils
catch
{
var assemblyVersion = AssemblyVersion;
return assemblyVersion.ProductVersion ?? assemblyVersion.FileVersion;
return assemblyVersion?.ProductVersion ?? assemblyVersion?.FileVersion;
}
}
}

Просмотреть файл

@ -61,6 +61,7 @@ namespace Microsoft.AppCenter.Crashes.Test.Windows
Crashes.ShouldAwaitUserConfirmation = null;
Crashes.GetErrorAttachments = null;
AppCenter.Instance.ApplicationSettings.Remove(Crashes.PrefKeyAlwaysSend);
AppCenter.Instance.ApplicationSettings.Remove(AppCenter.EnabledKey);
}
[TestMethod]

Просмотреть файл

@ -108,40 +108,6 @@ namespace Microsoft.AppCenter.Test.UWP
}
}
[TestMethod]
public void TestDbInitializationFolderNotExists()
{
// Make sure database directory does not exist before test.
if (Directory.Exists(Constants.AppCenterDatabasePath))
{
new DirectoryInfo(Constants.AppCenterDatabasePath).Delete(false);
}
using (var storageMock = new Storage.Storage())
{
storageMock.WaitOperationsAsync(TimeSpan.FromSeconds(10)).Wait();
// Verify that database is created inside local app data folder, and not locally.
Assert.IsTrue(File.Exists(Path.Combine(Constants.LocalAppData, Constants.AppCenterDatabaseFilename)));
}
}
[TestMethod]
public void TestDbInitializationFolderExists()
{
// Make sure database directory exists before test.
if (!Directory.Exists(Constants.AppCenterDatabasePath))
{
new DirectoryInfo(Constants.AppCenterDatabasePath).Create();
}
using (var storageMock = new Storage.Storage())
{
storageMock.WaitOperationsAsync(TimeSpan.FromSeconds(10)).Wait();
// Verify that database is created inside local app data folder, and not locally.
Assert.IsTrue(File.Exists(Path.Combine(Constants.LocalAppData, Constants.AppCenterDatabaseFilename)));
}
}
/// <summary>
/// Start service after unhandled exception
/// </summary>