Skip to content

Commit 7a5cc85

Browse files
Update Sample App + NuGet Packages
1 parent 386b5d5 commit 7a5cc85

File tree

13 files changed

+34
-46
lines changed

13 files changed

+34
-46
lines changed

Src/AsyncAwaitBestPractices.UnitTests/AsyncAwaitBestPractices.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="NUnit" Version="3.13.2" />
9-
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0">
9+
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0-beta.2">
1010
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1111
<PrivateAssets>all</PrivateAssets>
1212
</PackageReference>

Src/HackerNews.Shared/Models/StoryModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public StoryModel(long id, string by, long score, long time, string title, strin
1717

1818
public string Description => ToString();
1919

20-
2120
public long Id { get; }
2221
public string Author { get; }
2322
public long Score { get; }
@@ -28,7 +27,7 @@ public StoryModel(long id, string by, long score, long time, string title, strin
2827

2928
public override string ToString() => $"{Score} Points by {Author}, {GetAgeOfStory(CreatedAt_DateTimeOffset)} ago";
3029

31-
static string GetAgeOfStory(DateTimeOffset storyCreatedAt)
30+
static string GetAgeOfStory(in DateTimeOffset storyCreatedAt)
3231
{
3332
var timespanSinceStoryCreated = DateTimeOffset.UtcNow - storyCreatedAt;
3433

Src/HackerNews.UITests/AppInitializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace HackerNews.UITests
55
{
6-
public static class AppInitializer
6+
static class AppInitializer
77
{
88
public static IApp StartApp(Platform platform) => platform switch
99
{

Src/HackerNews.UITests/Pages/BasePage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace HackerNews.UITests
55
{
6-
public abstract class BasePage
6+
abstract class BasePage
77
{
88
protected BasePage(IApp app, string pageTitle)
99
{

Src/HackerNews.UITests/Pages/NewsPage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Threading;
54
using System.Threading.Tasks;
65
using HackerNews.Shared;
76
using Xamarin.UITest;
@@ -10,7 +9,7 @@
109

1110
namespace HackerNews.UITests
1211
{
13-
public class NewsPage : BasePage
12+
class NewsPage : BasePage
1413
{
1514
public NewsPage(IApp app) : base(app, PageTitleConstants.NewsPageTitle)
1615
{

Src/HackerNews.UITests/Tests/BaseTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using System;
22
using System.Threading.Tasks;
33
using NUnit.Framework;
4-
54
using Xamarin.UITest;
65

76
namespace HackerNews.UITests
87
{
98
[TestFixture(Platform.Android)]
109
[TestFixture(Platform.iOS)]
11-
public abstract class BaseTest
10+
abstract class BaseTest
1211
{
1312
readonly Platform _platform;
1413

Src/HackerNews.UITests/Tests/Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace HackerNews.UITests
88
{
9-
public class Tests : BaseTest
9+
class Tests : BaseTest
1010
{
1111
public Tests(Platform platform) : base(platform)
1212
{

Src/HackerNews/Constants/ColorConstants.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ namespace HackerNews
44
{
55
public static class ColorConstants
66
{
7-
public static Color NavigationBarBackgroundColor => Color.FromHex("FF6601");
8-
public static Color NavigationBarTextColor => Color.Black;
7+
public static Color NavigationBarBackgroundColor { get; } = Color.FromHex("FF6601");
8+
public static Color NavigationBarTextColor { get; } = Color.Black;
99

10-
public static Color TextCellDetailColor => Color.FromHex("828282");
11-
public static Color TextCellTextColor => Color.Black;
10+
public static Color TextCellDetailColor { get; } = Color.FromHex("828282");
11+
public static Color TextCellTextColor { get; } = Color.Black;
1212

13-
public static Color BrowserNavigationBarBackgroundColor => Color.FromHex("FFE6D5");
14-
public static Color BrowserNavigationBarTextColor => Color.FromHex("3F3F3F");
13+
public static Color BrowserNavigationBarBackgroundColor { get; } = Color.FromHex("FFE6D5");
14+
public static Color BrowserNavigationBarTextColor { get; } = Color.FromHex("3F3F3F");
1515
}
1616
}
1717

Src/HackerNews/HackerNews.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
88
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
99
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
10-
<PackageReference Include="Xamarin.CommunityToolkit.Markup" Version="1.1.0" />
10+
<PackageReference Include="Xamarin.CommunityToolkit.Markup" Version="1.2.0-pre2" />
1111
</ItemGroup>
1212
<ItemGroup>
1313
<Folder Include="Pages\Base\" />

Src/HackerNews/Pages/NewsPage.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using Xamarin.Forms;
2-
using HackerNews.Shared;
3-
using Xamarin.Essentials;
41
using System;
5-
using Xamarin.CommunityToolkit.Markup;
62
using System.Linq;
3+
using HackerNews.Shared;
4+
using Xamarin.CommunityToolkit.Markup;
5+
using Xamarin.Essentials;
6+
using Xamarin.Forms;
77

88
namespace HackerNews
99
{
@@ -55,8 +55,8 @@ async void HandleSelectionChanged(object sender, SelectionChangedEventArgs e)
5555
}
5656
}
5757

58-
void HandleErrorOccurred(object sender, string e) =>
59-
MainThread.BeginInvokeOnMainThread(async () => await DisplayAlert("Error", e, "OK"));
58+
async void HandleErrorOccurred(object sender, string e) =>
59+
await MainThread.InvokeOnMainThreadAsync(() => DisplayAlert("Error", e, "OK"));
6060

6161
}
6262
}

0 commit comments

Comments
 (0)