Skip to content

Commit

Permalink
chore: update internal dependencies (#3039)
Browse files Browse the repository at this point in the history
* update internal dependencies

* roll back verify.xunit

* roll back xunit.runner.visualstudio
  • Loading branch information
vaind committed Jan 12, 2024
1 parent a1ed6bd commit b181c58
Show file tree
Hide file tree
Showing 26 changed files with 92 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<ItemGroup>
<PackageReference Include="UnoptimizedAssemblyDetector" Version="0.1.1" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="4.9.0" PrivateAssets="All" />
</ItemGroup>

<!-- Import the root global usings, except for samples. -->
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/Sentry.Benchmarks/Sentry.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.5" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />

<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" />
<PackageReference Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="19.2.29" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="20.0.4" />
</ItemGroup>

<!-- only non-platform-specific projects should include these packages -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)'==''">
<PackageReference Include="Verify.Xunit" Version="20.0.0" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.1" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="Verify.Xunit" Version="22.11.4" />
<PackageReference Include="Verify.DiffPlex" Version="2.3.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<RootNamespace>Microsoft.Maui.TestUtils</RootNamespace>
<AssemblyName>Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen</AssemblyName>
<IsPackable>false</IsPackable>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.utility" Version="2.4.2" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.utility" Version="2.6.5" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.23252.4" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public static Bitmap AssertContainsColor(this Bitmap bitmap, AColor expectedColo
}
}

Assert.True(false, CreateColorError(bitmap, $"Color {expectedColor} not found."));
Assert.Fail(CreateColorError(bitmap, $"Color {expectedColor} not found."));
return bitmap;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static async Task<CanvasBitmap> AssertContainsColor(this CanvasBitmap bit
}
}

Assert.True(false, await CreateColorError(bitmap, $"Color {expectedColor} not found."));
Assert.Fail(await CreateColorError(bitmap, $"Color {expectedColor} not found."));
return bitmap;
}

Expand Down
12 changes: 2 additions & 10 deletions test/MauiTestUtils/DeviceTests/AssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.Maui.DeviceTests;

public static partial class AssertionExtensions
{
static readonly Random rnd = new Random();
static private readonly Random rnd = new Random();

public static async Task<bool> Wait(Func<bool> exitCondition, int timeout = 1000)
{
Expand All @@ -22,14 +22,6 @@ public static async Task<bool> Wait(Func<bool> exitCondition, int timeout = 1000
return exitCondition.Invoke();
}

public static void AssertHasFlag(this Enum self, Enum flag)
{
var hasFlag = self.HasFlag(flag);

if (!hasFlag)
throw new ContainsException(flag, self);
}

public static void AssertWithMessage(Action assertion, string message)
{
try
Expand All @@ -38,7 +30,7 @@ public static void AssertWithMessage(Action assertion, string message)
}
catch (Exception e)
{
Assert.True(false, $"Message: {message} Failure: {e}");
Assert.Fail($"Message: {message} Failure: {e}");
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/MauiTestUtils/DeviceTests/TestUtils.DeviceTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.utility" Version="2.4.2" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.utility" Version="2.6.5" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.23252.4" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async Task VerifyAsync(HttpRequestMessage message)
"Expected SDK name to be in the payload");
return; // pass
}
Assert.False(true, "Exception should bubble from Middleware");
Assert.Fail("Exception should bubble from Middleware");
}

public class FailingFunction : IHttpFunction
Expand Down
16 changes: 8 additions & 8 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void Application_UnbindChildElementEvents_DoesNotAddBreadcrumb(string eve

var element = Substitute.For<Element>();
application.RaiseEvent(eventName, new ElementEventArgs(element));
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleApplicationEvents(application, bind: false);

Expand All @@ -50,7 +50,7 @@ public void Application_UnbindChildElementEvents_DoesNotAddBreadcrumb(string eve

// Assert
application.RaiseEvent(eventName, new ElementEventArgs(element));
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Theory]
Expand Down Expand Up @@ -93,15 +93,15 @@ public void Application_UnbindPageEvents_DoesNotAddBreadcrumb(string eventName)
};

application.RaiseEvent(eventName, page);
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleApplicationEvents(application, bind: false);

// Act
application.RaiseEvent(eventName, page);

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Theory]
Expand Down Expand Up @@ -134,15 +134,15 @@ public void Application_UnbindModalEvents_DoesNotAddBreadcrumb(string eventName,
_fixture.Binder.HandleApplicationEvents(application);

application.RaiseEvent(eventName, eventArgs);
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleApplicationEvents(application, bind: false);

// Act
application.RaiseEvent(eventName, eventArgs);

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

public static IEnumerable<object[]> ApplicationModalEventsData
Expand Down Expand Up @@ -192,14 +192,14 @@ public void Application_UnbindRequestedThemeChanged_DoesNotAddBreadcrumb()
_fixture.Binder.HandleApplicationEvents(application);

application.UserAppTheme = AppTheme.Dark;
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleApplicationEvents(application, bind: false);

// Act
application.UserAppTheme = AppTheme.Light;

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}
}
4 changes: 2 additions & 2 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ public void Button_UnbindCommonEvents_DoesNotAddBreadcrumb(string eventName)
};
_fixture.Binder.HandleButtonEvents(button);
button.RaiseEvent(eventName, EventArgs.Empty);
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleButtonEvents(button, bind: false);

// Act
button.RaiseEvent(eventName, EventArgs.Empty);

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}
}
12 changes: 6 additions & 6 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.Element.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public void Element_UnbindChildEvents_DoesNotAddBreadcrumb(string eventName)
var child = new MockElement("child");

parent.RaiseEvent(eventName, new ElementEventArgs(child));
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleElementEvents(parent, bind: false);

// Act
parent.RaiseEvent(eventName, new ElementEventArgs(child));

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Fact]
Expand Down Expand Up @@ -88,15 +88,15 @@ public void Element_UnbindParentChanged_DoesNotAddBreadcrumb()
_fixture.Binder.HandleElementEvents(element);

element.RaiseEvent(nameof(Application.ParentChanged), EventArgs.Empty);
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleElementEvents(element, bind: false);

// Act
element.RaiseEvent(nameof(Application.ParentChanged), EventArgs.Empty);

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Fact]
Expand Down Expand Up @@ -132,14 +132,14 @@ public void Element_UnbindBindingContextChanged_DoesNotAddBreadcrumb()
var otherBindingContext = Substitute.For<object>();

element.BindingContext = bindingContext;
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleElementEvents(element, bind: false);

// Act
element.BindingContext = otherBindingContext;

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}
}
8 changes: 4 additions & 4 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public void Page_UnbindLifecycleEvents_DoesNotAddBreadcrumb(string eventName)
_fixture.Binder.HandlePageEvents(page);

page.RaiseEvent(eventName, EventArgs.Empty);
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandlePageEvents(page, bind: false);

// Act
page.RaiseEvent(eventName, EventArgs.Empty);

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Fact]
Expand Down Expand Up @@ -105,15 +105,15 @@ public void Page_UnbindNavigatedTo_AddsBreadcrumb()
.Invoke(new object[] {otherPage});

page.RaiseEvent(nameof(Page.NavigatedTo), navigatedToEventArgs);
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandlePageEvents(page, bind: false);

// Act
page.RaiseEvent(nameof(Page.NavigatedTo), navigatedToEventArgs);

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Fact]
Expand Down
8 changes: 4 additions & 4 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public void Shell_UnbindNavigating_DoesNotAddBreadcrumb()
const ShellNavigationSource source = ShellNavigationSource.Push;

shell.RaiseEvent(nameof(Shell.Navigating), new ShellNavigatingEventArgs(current, target, source, false));
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleShellEvents(shell, bind: false);

// Act
shell.RaiseEvent(nameof(Shell.Navigating), new ShellNavigatingEventArgs(target, current, source, false));

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}

[Fact]
Expand Down Expand Up @@ -103,14 +103,14 @@ public void Shell_UnbindNavigated_DoesNotAddBreadcrumb()
const ShellNavigationSource source = ShellNavigationSource.Push;

shell.RaiseEvent(nameof(Shell.Navigated), new ShellNavigatedEventArgs(previous, current, source));
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleShellEvents(shell, bind: false);

// Act
shell.RaiseEvent(nameof(Shell.Navigated), new ShellNavigatedEventArgs(current, previous, source));

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}
}
4 changes: 2 additions & 2 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.VisualElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public void VisualElement_UnbindFocusEvents_DoesNotAddBreadcrumb(string eventNam
_fixture.Binder.HandleVisualElementEvents(element);

element.RaiseEvent(eventName, new FocusEventArgs(element, isFocused));
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count); // Sanity check
Assert.Single(_fixture.Scope.Breadcrumbs); // Sanity check

_fixture.Binder.HandleVisualElementEvents(element, bind: false);

// Act
element.RaiseEvent(eventName, new FocusEventArgs(element, isFocused));

// Assert
Assert.Equal(1, _fixture.Scope.Breadcrumbs.Count);
Assert.Single(_fixture.Scope.Breadcrumbs);
}
}
Loading

0 comments on commit b181c58

Please sign in to comment.