Skip to content

Commit beadb57

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/catbag - Fix wrong ctor types for RuntimeFact/Theory devlooped/catbag@4091497
1 parent a4597a6 commit beadb57

File tree

3 files changed

+80
-4
lines changed

3 files changed

+80
-4
lines changed

.netconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@
137137
weak
138138
[file "src/AI.Tests/Extensions/Attributes.cs"]
139139
url = https://github.com/devlooped/catbag/blob/main/Xunit/Attributes.cs
140-
sha = 615c1e2521340dcd85132807b368a52ff53e4ba7
140+
sha = 40914971d4d6b42d6f8a90923b131136f7e609a5
141141

142-
etag = ec1645067cc2319c2ce3304900c260eb8ec700d50b6d8d62285914a6c96e01f9
142+
etag = c77e7b435ce1df06fb60a3b0e15a0833d8e45d4d19f366c6184140ebb4814b1a
143143
weak
144144
[file "src/dotnet-meai/Sponsors/SponsorManifest.cs"]
145145
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorManifest.cs

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Extensions for [Microsoft.Extensions.AI](https://nuget.org/packages/Microsoft.Ex
4646
[![domischell](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/DominicSchell.png "domischell")](https://github.com/DominicSchell)
4747
[![Mauricio Scheffer](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mausch.png "Mauricio Scheffer")](https://github.com/mausch)
4848
[![Justin Wendlandt](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jwendl.png "Justin Wendlandt")](https://github.com/jwendl)
49+
[![Adrian Alonso](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/adalon.png "Adrian Alonso")](https://github.com/adalon)
50+
[![Michael Hagedorn](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Eule02.png "Michael Hagedorn")](https://github.com/Eule02)
51+
[![Matt Frear](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mattfrear.png "Matt Frear")](https://github.com/mattfrear)
4952

5053

5154
<!-- sponsors.md -->

src/AI.Tests/Extensions/Attributes.cs

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using System;
1+
#nullable enable
2+
using System;
23
using System.Collections.Generic;
4+
using System.Runtime.InteropServices;
35
using Microsoft.Extensions.Configuration;
4-
using Xunit;
56

67
namespace Xunit;
78

@@ -45,6 +46,78 @@ public CIFactAttribute()
4546
}
4647
}
4748

49+
public class RuntimeFactAttribute : FactAttribute
50+
{
51+
/// <summary>
52+
/// Use <c>nameof(OSPLatform.Windows|Linux|OSX|FreeBSD)</c>
53+
/// </summary>
54+
public RuntimeFactAttribute(string osPlatform)
55+
{
56+
if (osPlatform != null && !RuntimeInformation.IsOSPlatform(OSPlatform.Create(osPlatform)))
57+
Skip = $"Only running on {osPlatform}.";
58+
}
59+
60+
public RuntimeFactAttribute(Architecture architecture)
61+
{
62+
if (RuntimeInformation.ProcessArchitecture != architecture)
63+
Skip = $"Requires {architecture} but was {RuntimeInformation.ProcessArchitecture}.";
64+
}
65+
66+
/// <summary>
67+
/// Empty constructor for use in combination with RuntimeIdentifier property.
68+
/// </summary>
69+
public RuntimeFactAttribute() { }
70+
71+
/// <summary>
72+
/// Sets the runtime identifier the test requires to run.
73+
/// </summary>
74+
public string? RuntimeIdentifier
75+
{
76+
get => RuntimeInformation.RuntimeIdentifier;
77+
set
78+
{
79+
if (value != null && RuntimeInformation.RuntimeIdentifier != value)
80+
Skip += $"Requires {value} but was {RuntimeInformation.RuntimeIdentifier}.";
81+
}
82+
}
83+
}
84+
85+
public class RuntimeTheoryAttribute : TheoryAttribute
86+
{
87+
/// <summary>
88+
/// Use <c>nameof(OSPLatform.Windows|Linux|OSX|FreeBSD)</c>
89+
/// </summary>
90+
public RuntimeTheoryAttribute(string osPlatform)
91+
{
92+
if (osPlatform != null && !RuntimeInformation.IsOSPlatform(OSPlatform.Create(osPlatform)))
93+
Skip = $"Only running on {osPlatform}.";
94+
}
95+
96+
public RuntimeTheoryAttribute(Architecture architecture)
97+
{
98+
if (RuntimeInformation.ProcessArchitecture != architecture)
99+
Skip = $"Requires {architecture} but was {RuntimeInformation.ProcessArchitecture}.";
100+
}
101+
102+
/// <summary>
103+
/// Empty constructor for use in combination with RuntimeIdentifier property.
104+
/// </summary>
105+
public RuntimeTheoryAttribute() { }
106+
107+
/// <summary>
108+
/// Sets the runtime identifier the test requires to run.
109+
/// </summary>
110+
public string? RuntimeIdentifier
111+
{
112+
get => RuntimeInformation.RuntimeIdentifier;
113+
set
114+
{
115+
if (value != null && RuntimeInformation.RuntimeIdentifier != value)
116+
Skip += $"Requires {value} but was {RuntimeInformation.RuntimeIdentifier}.";
117+
}
118+
}
119+
}
120+
48121
public class SecretsTheoryAttribute : TheoryAttribute
49122
{
50123
public SecretsTheoryAttribute(params string[] secrets)

0 commit comments

Comments
 (0)