[tests] Adjust ConfigTest to cope with different behavior when using NativeAOT.
This commit is contained in:
Родитель
97b91f1600
Коммит
c49888bee1
|
@ -13,8 +13,17 @@ namespace MonoTouchFixtures {
|
|||
[Test]
|
||||
public void Existence ()
|
||||
{
|
||||
#if NATIVEAOT
|
||||
#if __MACCATALYST__ || __MACOS__
|
||||
var config_dir = Path.Combine (Path.GetDirectoryName (AppContext.BaseDirectory.TrimEnd ('/')), "MonoBundle");
|
||||
#else
|
||||
var config_dir = AppContext.BaseDirectory;
|
||||
#endif
|
||||
var config_file = Path.Combine (config_dir, Assembly.GetExecutingAssembly ().GetName ().Name + ".dll.config");
|
||||
#else
|
||||
var config_file = Assembly.GetExecutingAssembly ().Location + ".config";
|
||||
Assert.True (File.Exists (config_file), "existence");
|
||||
#endif
|
||||
Assert.That (config_file, Does.Exist, "existence");
|
||||
Assert.That (File.ReadAllText (config_file), Contains.Substring ("<secretMessage>Xamarin rocks</secretMessage>"), "content");
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче