diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
index fc5880056b6f..f16ccfd1c90a 100644
--- a/src/Directory.Build.targets
+++ b/src/Directory.Build.targets
@@ -6,6 +6,9 @@
$(AssemblyName) ($(TargetFramework) $(UnoRuntimeIdentifier))
8.2.2
true
+
+
+ $(RestoreAdditionalProjectSources);https://dnceng.pkgs.visualstudio.com/public/_packaging/test-tools/nuget/v3/index.json
@@ -64,12 +67,13 @@
-
+
+
- 3.7.1
- 1.5.1
+ 3.8.0-preview.25067.5
+ 1.6.0-preview.25067.5
2.88.7
diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Given_PathMarkupParser.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Given_PathMarkupParser.cs
index 29d38db7e785..eb5b4abec32b 100644
--- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Given_PathMarkupParser.cs
+++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Given_PathMarkupParser.cs
@@ -210,7 +210,7 @@ public void Parsed_Geometry_ToString_Should_Format_Value(string pathData, string
[DataRow("j")]
public void Throws_InvalidDataException_On_None_Defined_Command(string pathData)
{
- Assert.ThrowsException(() => Parse(pathData));
+ Assert.ThrowsExactly(() => Parse(pathData));
}
[TestMethod]
diff --git a/src/Uno.UI.RuntimeTests/MUX/Utilities/MSTestInterop.cs b/src/Uno.UI.RuntimeTests/MUX/Utilities/MSTestInterop.cs
index 10a8eef97d9d..df4d542415c7 100644
--- a/src/Uno.UI.RuntimeTests/MUX/Utilities/MSTestInterop.cs
+++ b/src/Uno.UI.RuntimeTests/MUX/Utilities/MSTestInterop.cs
@@ -163,12 +163,12 @@ public static void Fail(string message, params object[] args)
public static void Throws(Action action, string message) where T : Exception
{
- Assert.ThrowsException(action, message);
+ Assert.ThrowsExactly(action, message);
}
public static void Throws(Action action) where T : Exception
{
- Assert.ThrowsException(action);
+ Assert.ThrowsExactly(action);
}
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Uno_Helpers/Given_AppDataUriEvaluator.cs b/src/Uno.UI.RuntimeTests/Tests/Uno_Helpers/Given_AppDataUriEvaluator.cs
index 095f33ea90c0..50d26946a8c0 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Uno_Helpers/Given_AppDataUriEvaluator.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Uno_Helpers/Given_AppDataUriEvaluator.cs
@@ -18,7 +18,7 @@ public class Given_AppDataUriEvaluator
[TestMethod]
public void When_Uri_Is_Null()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(null));
}
@@ -27,7 +27,7 @@ public void When_Uri_Has_Different_Scheme()
{
var uri = new Uri("ms-appx:///local/test.txt");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -36,7 +36,7 @@ public void When_Uri_Is_Not_Absolute()
{
var uri = new Uri("local/test.txt", UriKind.Relative);
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -45,7 +45,7 @@ public void When_Uri_Has_No_Path()
{
var uri = new Uri("ms-appdata:");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -54,7 +54,7 @@ public void When_Uri_Has_No_Subfolder_Specification()
{
var uri = new Uri("ms-appdata:///");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -93,7 +93,7 @@ public void When_Uri_Is_RoamingFolder_But_Has_Suffix()
{
var uri = new Uri("ms-appdata:///roamingfolder/");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -112,7 +112,7 @@ public void When_Uri_Starts_With_Invalid_Folder()
{
var uri = new Uri($"ms-appdata:///space/file.png");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -147,7 +147,7 @@ public void When_Uri_Contains_Package_Name_But_Has_Suffix()
var packageName = Package.Current.Id.Name;
var uri = new Uri($"ms-appdata://{packageName}abcd/local/file.png");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
@@ -195,7 +195,7 @@ public void When_Double_Dot_Backs_Out_Above_App_Data()
{
var uri = new Uri("ms-appdata:///local/../hello/logo.png");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => AppDataUriEvaluator.ToPath(uri));
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailManager.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailManager.cs
index 479d35bd8c98..294bfc4a2487 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailManager.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailManager.cs
@@ -15,7 +15,7 @@ public class Given_EmailManager
[TestMethod]
public async Task When_EmailMessage_Is_Null()
{
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await EmailManager.ShowComposeNewEmailAsync(null));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailMessage.cs
index f3297f2edbd5..9101b02235fb 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailMessage.cs
@@ -58,7 +58,7 @@ public void When_Body_Default()
public void When_Body_Set_Null()
{
var emailMessage = new EmailMessage();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailMessage.Body = null);
}
@@ -66,7 +66,7 @@ public void When_Body_Set_Null()
public void When_Subject_Set_Null()
{
var emailMessage = new EmailMessage();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailMessage.Subject = null);
}
@@ -83,7 +83,7 @@ public void When_Sender_Set_Null()
public void When_Null_To_Recipient_Is_Added()
{
var emailMessage = new EmailMessage();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailMessage.To.Add(null));
}
@@ -91,7 +91,7 @@ public void When_Null_To_Recipient_Is_Added()
public void When_Null_CC_Recipient_Is_Added()
{
var emailMessage = new EmailMessage();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailMessage.CC.Add(null));
}
@@ -99,7 +99,7 @@ public void When_Null_CC_Recipient_Is_Added()
public void When_Null_Bcc_Recipient_Is_Added()
{
var emailMessage = new EmailMessage();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailMessage.Bcc.Add(null));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailRecipient.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailRecipient.cs
index 18a9a2e279ce..560952b8aa15 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailRecipient.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_ApplicationModel/Email/Given_EmailRecipient.cs
@@ -15,14 +15,14 @@ public class Given_EmailRecipient
[TestMethod]
public void When_Address_Is_Null()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new EmailRecipient(null));
}
[TestMethod]
public void When_Name_Is_Null()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new EmailRecipient("someone@example.com", null));
}
@@ -30,7 +30,7 @@ public void When_Name_Is_Null()
public void When_Address_Set_Null()
{
var emailRecipient = new EmailRecipient();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailRecipient.Address = null);
}
@@ -38,7 +38,7 @@ public void When_Address_Set_Null()
public void When_Name_Set_Null()
{
var emailRecipient = new EmailRecipient();
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => emailRecipient.Name = null);
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiChannelPressureMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiChannelPressureMessage.cs
index 13d68ae7ce6b..3421fd69bed3 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiChannelPressureMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiChannelPressureMessage.cs
@@ -20,14 +20,14 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiChannelPressureMessage(16, 10));
}
[TestMethod]
public void When_Pressure_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiChannelPressureMessage(12, 128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiControlChangeMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiControlChangeMessage.cs
index 96784b5c3a6b..24915d693a1f 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiControlChangeMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiControlChangeMessage.cs
@@ -20,21 +20,21 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiControlChangeMessage(16, 10, 10));
}
[TestMethod]
public void When_Controller_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiControlChangeMessage(12, 128, 10));
}
[TestMethod]
public void When_ControlChange_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiControlChangeMessage(12, 10, 128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOffMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOffMessage.cs
index cff793811736..96cf9572ca4e 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOffMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOffMessage.cs
@@ -20,21 +20,21 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOffMessage(16, 10, 10));
}
[TestMethod]
public void When_Note_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOffMessage(12, 128, 10));
}
[TestMethod]
public void When_Velocity_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOffMessage(12, 10, 128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOnMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOnMessage.cs
index 7941833b69cd..ddeb1114122d 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOnMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiNoteOnMessage.cs
@@ -20,21 +20,21 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOnMessage(16, 10, 10));
}
[TestMethod]
public void When_Note_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOnMessage(12, 128, 10));
}
[TestMethod]
public void When_Velocity_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOnMessage(12, 10, 128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPitchBendChangeMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPitchBendChangeMessage.cs
index 0a7f2e19340d..80d265a0182e 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPitchBendChangeMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPitchBendChangeMessage.cs
@@ -20,14 +20,14 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiPitchBendChangeMessage(16, 10));
}
[TestMethod]
public void When_Bend_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiPitchBendChangeMessage(12, 16384));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPolyphonicKeyPressureMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPolyphonicKeyPressureMessage.cs
index e00cb1e70f0a..31c994fd0be1 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPolyphonicKeyPressureMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiPolyphonicKeyPressureMessage.cs
@@ -20,21 +20,21 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOnMessage(16, 10, 10));
}
[TestMethod]
public void When_Note_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOnMessage(12, 128, 10));
}
[TestMethod]
public void When_Pressure_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiNoteOnMessage(12, 10, 128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiProgramChangeMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiProgramChangeMessage.cs
index 6dd24f3f55c6..c67a190f7f2b 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiProgramChangeMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiProgramChangeMessage.cs
@@ -20,14 +20,14 @@ public void When_RawData()
[TestMethod]
public void When_Channel_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiProgramChangeMessage(16, 10));
}
[TestMethod]
public void When_Pressure_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiProgramChangeMessage(12, 128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongPositionMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongPositionMessage.cs
index 05974fccab30..1947cd3c3ff6 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongPositionMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongPositionMessage.cs
@@ -20,7 +20,7 @@ public void When_RawData()
[TestMethod]
public void When_Beats_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiPitchBendChangeMessage(12, 16384));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongSelectMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongSelectMessage.cs
index 7dc3bba06eef..8ea704034730 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongSelectMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSongSelectMessage.cs
@@ -20,7 +20,7 @@ public void When_RawData()
[TestMethod]
public void When_Song_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiSongSelectMessage(128));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSystemExclusiveMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSystemExclusiveMessage.cs
index a27ad4b1cb1e..b31443843a51 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSystemExclusiveMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiSystemExclusiveMessage.cs
@@ -13,7 +13,7 @@ public class Given_MidiSystemExclusiveMessage
[TestMethod]
public void When_RawData_Empty()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiSystemExclusiveMessage(Array.Empty().ToBuffer()));
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiTimeCodeMessage.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiTimeCodeMessage.cs
index 0b54e0821ee9..1fc57758d358 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiTimeCodeMessage.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Devices/Midi/Given_MidiTimeCodeMessage.cs
@@ -20,14 +20,14 @@ public void When_RawData()
[TestMethod]
public void When_FrameType_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiTimeCodeMessage(8, 10));
}
[TestMethod]
public void When_Values_Out_Of_Bounds()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => new MidiTimeCodeMessage(5, 33));
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_Calendar.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_Calendar.cs
index 3921fb9b4336..fff16989ade6 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_Calendar.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_Calendar.cs
@@ -135,23 +135,23 @@ public void When_Switch_Period()
public void When_TwentyFourHour_Invalid_Hours()
{
var calendar = new Calendar(new[] { "en-US" }, CalendarIdentifiers.Gregorian, ClockIdentifiers.TwentyFourHour);
- Assert.ThrowsException(() => calendar.Hour = -1);
- Assert.ThrowsException(() => calendar.Hour = 24);
+ Assert.ThrowsExactly(() => calendar.Hour = -1);
+ Assert.ThrowsExactly(() => calendar.Hour = 24);
}
[TestMethod]
public void When_TwentyFourHour_Invalid_Period()
{
var calendar = new Calendar(new[] { "en-US" }, CalendarIdentifiers.Gregorian, ClockIdentifiers.TwentyFourHour);
- Assert.ThrowsException(() => calendar.Period = 2);
+ Assert.ThrowsExactly(() => calendar.Period = 2);
}
[TestMethod]
public void When_TwelveHour_Invalid_Period()
{
var calendar = new Calendar(new[] { "en-US" }, CalendarIdentifiers.Gregorian, ClockIdentifiers.TwelveHour);
- Assert.ThrowsException(() => calendar.Period = 0);
- Assert.ThrowsException(() => calendar.Period = 3);
+ Assert.ThrowsExactly(() => calendar.Period = 0);
+ Assert.ThrowsExactly(() => calendar.Period = 3);
}
[TestMethod]
@@ -171,10 +171,10 @@ public void When_TwentyFourHour()
public void When_TwelveHour_Invalid_Hours()
{
var calendar = new Calendar(new[] { "en-US" }, CalendarIdentifiers.Gregorian, ClockIdentifiers.TwelveHour);
- Assert.ThrowsException(() => calendar.Hour = 0);
+ Assert.ThrowsExactly(() => calendar.Hour = 0);
for (int hour = 13; hour <= 23; hour++)
{
- Assert.ThrowsException(() => calendar.Hour = hour);
+ Assert.ThrowsExactly(() => calendar.Hour = hour);
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_DateTimeFormatter.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_DateTimeFormatter.cs
index 54ebd37a74cc..96afd6651343 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_DateTimeFormatter.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Globalization/Given_DateTimeFormatter.cs
@@ -62,7 +62,7 @@ public void When_CallingFormatWithTimeZone_ShouldThrowNotSupportedException()
var formatter = new DateTimeFormatter("longdate");
var dateToFormat = new DateTimeOffset(2024, 1, 15, 0, 0, 0, TimeSpan.Zero);
- Assert.ThrowsException(() =>
+ Assert.ThrowsExactly(() =>
formatter.Format(dateToFormat, "UTC"));
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_ApplicationDataContainer.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_ApplicationDataContainer.cs
index 7465803c4162..4a42f7e85648 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_ApplicationDataContainer.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_ApplicationDataContainer.cs
@@ -245,7 +245,7 @@ public void When_AddIsCalledRepeatedly()
var value = "something";
var secondValue = "somethingElse";
SUT.Values.Add(key, value);
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => SUT.Values.Add(key, secondValue));
}
@@ -267,7 +267,7 @@ public void When_AddNullTriesToClearSetting()
var key = "test";
var value = "something";
SUT.Values.Add(key, value);
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => SUT.Values.Add(key, null));
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs
index b091c9dd6d54..531ff33b57e5 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs
@@ -122,8 +122,8 @@ public async Task When_Open_Read_AndGetOutputStream()
{
var path = GetRandomFilePath();
var storageFile = await GetFile(path);
- var stream = storageFile.OpenAsync(FileAccessMode.Read);
- Assert.Throws(() => stream.GetOutputStreamAt(0));
+ var stream = await storageFile.OpenAsync(FileAccessMode.Read);
+ Assert.Throws(() => stream.GetOutputStreamAt(0));
}
[TestMethod]
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder.cs
index e76f4d6aba08..7cd26f19e19e 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder.cs
@@ -18,7 +18,7 @@ public async Task When_CreateFile_FailIfExists()
await folder.CreateFileAsync(filename);
- await Assert.ThrowsExceptionAsync(() => folder.CreateFileAsync(filename).AsTask());
+ await Assert.ThrowsExactlyAsync(() => folder.CreateFileAsync(filename).AsTask());
}
[TestMethod]
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder_Native.base.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder_Native.base.cs
index 601de061e308..5b0cd2d7b22f 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder_Native.base.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder_Native.base.cs
@@ -447,14 +447,14 @@ public async Task When_CreateFile_Duplicate_Folder_GenerateUniqueName()
public async Task When_GetFile_File_Does_Not_Exist()
{
var rootFolder = await GetRootFolderAsync();
- await Assert.ThrowsExceptionAsync(async () => await rootFolder.GetFileAsync("a.txt"));
+ await Assert.ThrowsExactlyAsync(async () => await rootFolder.GetFileAsync("a.txt"));
}
[TestMethod]
public async Task When_GetFolder_Folder_Does_Not_Exist()
{
var rootFolder = await GetRootFolderAsync();
- await Assert.ThrowsExceptionAsync(async () => await rootFolder.GetFolderAsync("a"));
+ await Assert.ThrowsExactlyAsync(async () => await rootFolder.GetFolderAsync("a"));
}
[TestMethod]
@@ -466,7 +466,7 @@ public async Task When_GetFile_Folder_Exists()
try
{
createdFolder = await rootFolder.CreateFolderAsync(fileName);
- await Assert.ThrowsExceptionAsync(async () => await rootFolder.GetFileAsync(fileName));
+ await Assert.ThrowsExactlyAsync(async () => await rootFolder.GetFileAsync(fileName));
}
finally
{
@@ -484,7 +484,7 @@ public async Task When_GetFolder_File_Exists()
try
{
createdFile = await rootFolder.CreateFileAsync(folderName);
- await Assert.ThrowsExceptionAsync(async () => await rootFolder.GetFolderAsync(folderName));
+ await Assert.ThrowsExactlyAsync(async () => await rootFolder.GetFolderAsync(folderName));
}
finally
{
@@ -535,14 +535,14 @@ public async Task When_GetFolder_Folder_Exists()
public async Task When_GetItem_File_Does_Not_Exist()
{
var rootFolder = await GetRootFolderAsync();
- await Assert.ThrowsExceptionAsync(async () => await rootFolder.GetItemAsync("a.txt"));
+ await Assert.ThrowsExactlyAsync(async () => await rootFolder.GetItemAsync("a.txt"));
}
[TestMethod]
public async Task When_GetItem_Folder_Does_Not_Exist()
{
var rootFolder = await GetRootFolderAsync();
- await Assert.ThrowsExceptionAsync(async () => await rootFolder.GetItemAsync("a"));
+ await Assert.ThrowsExactlyAsync(async () => await rootFolder.GetItemAsync("a"));
}
[TestMethod]
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Streams/Given_DataReader.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Streams/Given_DataReader.cs
index a683229c52ef..5752bb6298c7 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Streams/Given_DataReader.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Streams/Given_DataReader.cs
@@ -12,7 +12,7 @@ public class When_DataReader
[TestMethod]
public void When_FromBuffer_Argument_Null()
{
- Assert.ThrowsException(() => DataReader.FromBuffer(null));
+ Assert.ThrowsExactly(() => DataReader.FromBuffer(null));
}
[TestMethod]
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_System/Given_Launcher.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_System/Given_Launcher.cs
index f11dbdef3cf6..fc3b474393a6 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_System/Given_Launcher.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_System/Given_Launcher.cs
@@ -15,13 +15,13 @@ public class Given_Launcher
[TestMethod]
public async Task When_Null_Uri_Is_Launched()
{
- await Assert.ThrowsExceptionAsync(() => Launcher.LaunchUriAsync(null).AsTask());
+ await Assert.ThrowsExactlyAsync(() => Launcher.LaunchUriAsync(null).AsTask());
}
[TestMethod]
public async Task When_Null_Uri_Is_Queried()
{
- await Assert.ThrowsExceptionAsync(() => Launcher.QueryUriSupportAsync(null, LaunchQuerySupportType.Uri).AsTask());
+ await Assert.ThrowsExactlyAsync(() => Launcher.QueryUriSupportAsync(null, LaunchQuerySupportType.Uri).AsTask());
}
[TestMethod]
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_StartScreen/Given_JumpListItem.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_StartScreen/Given_JumpListItem.cs
index 0755b1ffb695..9c38641595c8 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_StartScreen/Given_JumpListItem.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_StartScreen/Given_JumpListItem.cs
@@ -15,7 +15,7 @@ public class Given_JumpListItem
[TestMethod]
public void When_Arguments_Are_Null()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => JumpListItem.CreateWithArguments(null, "Hello"));
}
@@ -29,7 +29,7 @@ public void When_Arguments_Are_Empty()
[TestMethod]
public void When_DisplayName_Is_Null()
{
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => JumpListItem.CreateWithArguments("Hello", null));
}
@@ -58,7 +58,7 @@ public void When_Arguments_Are_Set()
public void When_Description_Is_Set_To_Null()
{
var item = JumpListItem.CreateWithArguments("Hello", "test");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => item.Description = null);
}
@@ -76,7 +76,7 @@ public void When_Instance_Is_Created_Default_Values()
public void When_Logo_Uri_Is_Web()
{
var item = JumpListItem.CreateWithArguments("Hello", "Test");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => item.Logo = new Uri("https://www.example.com/image.png"));
}
@@ -84,7 +84,7 @@ public void When_Logo_Uri_Is_Web()
public void When_Logo_Uri_Is_File_Path()
{
var item = JumpListItem.CreateWithArguments("Hello", "Test");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => item.Logo = new Uri("C:\\Dev\\Hello.png"));
}
@@ -100,7 +100,7 @@ public void When_Logo_Uri_Is_Set_To_Null()
public void When_Logo_Uri_Is_ms_appdata()
{
var item = JumpListItem.CreateWithArguments("Hello", "Test");
- Assert.ThrowsException(
+ Assert.ThrowsExactly(
() => item.Logo = new Uri("ms-appdata:///Test.png"));
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_DependencyObjectCollection.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_DependencyObjectCollection.cs
index 1814b458e3f5..b768ef889735 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_DependencyObjectCollection.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_DependencyObjectCollection.cs
@@ -39,6 +39,6 @@ public void When_Indexer_Get_IndexOutOfRange()
[TestMethod]
public void When_Indexer_Get_NegativeIndex()
{
- Assert.ThrowsException(() => new DependencyObjectCollection()[-1]);
+ Assert.ThrowsExactly(() => _ = new DependencyObjectCollection()[-1]);
}
}
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement.cs
index edc700c4aad0..d34db02a1b1f 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement.cs
@@ -641,9 +641,9 @@ public Task MeasureWithNan() =>
SUT.Measure(new Size(42.0, double.NaN));
SUT.Measure(new Size(double.NaN, 42.0));
#else
- Assert.ThrowsException(() => SUT.Measure(new Size(double.NaN, double.NaN)));
- Assert.ThrowsException(() => SUT.Measure(new Size(42.0, double.NaN)));
- Assert.ThrowsException(() => SUT.Measure(new Size(double.NaN, 42.0)));
+ Assert.ThrowsExactly(() => SUT.Measure(new Size(double.NaN, double.NaN)));
+ Assert.ThrowsExactly(() => SUT.Measure(new Size(42.0, double.NaN)));
+ Assert.ThrowsExactly(() => SUT.Measure(new Size(double.NaN, 42.0)));
#endif
});
@@ -1106,7 +1106,7 @@ public async Task When_Add_Element_While_Parent_Loading_Then_Load_Raised()
sut.Loading += (snd, e) => loadingCount++;
sut.Loaded += (snd, e) => loadedCount++;
- hostPanel.Loading += async (snd, e) =>
+ hostPanel.Loading += (snd, e) =>
{
hostPanel.Children.Add(sut);
diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement_Layouting.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement_Layouting.cs
index 4b6f3aeb95d8..91ee0aa09005 100644
--- a/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement_Layouting.cs
+++ b/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement_Layouting.cs
@@ -172,7 +172,7 @@ static WeakReference