forked from NuGet/NuGet.Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentModelResourceTests.cs
More file actions
28 lines (24 loc) · 912 Bytes
/
ContentModelResourceTests.cs
File metadata and controls
28 lines (24 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Xunit;
namespace NuGet.Client.Test
{
public class ContentModelResourceTests
{
[MemberData(nameof(AllCultures))]
[Theory]
public void CanParseEverySystemKnownCultureResource(CultureInfo culture)
{
var result = ManagedCodeConventions.Locale_Parser(culture.Name.AsMemory(), null, false);
Assert.Equal(culture.Name, result as string);
}
public static IEnumerable<object[]> AllCultures()
{
return CultureInfo.GetCultures(CultureTypes.AllCultures).Where(c => !string.IsNullOrEmpty(c.Name)).Select(culture => new[] { culture });
}
}
}