@@ -12,4 +12,12 @@ namespace k8s
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
IList<T> Items { get; set; }
|
IList<T> Items { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class ItemsExt
|
||||||
|
{
|
||||||
|
public static IEnumerator<T> GetEnumerator<T>(this IItems<T> items)
|
||||||
|
{
|
||||||
|
return items.Items.GetEnumerator();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
tests/KubernetesClient.Tests/ItemsEnumTests.cs
Normal file
22
tests/KubernetesClient.Tests/ItemsEnumTests.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using Xunit;
|
||||||
|
using k8s.Models;
|
||||||
|
|
||||||
|
namespace k8s.Tests;
|
||||||
|
|
||||||
|
public class ItemsEnumTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void EnsureIItemsEnumerable()
|
||||||
|
{
|
||||||
|
var pods = new V1PodList
|
||||||
|
{
|
||||||
|
Items = new[] { new V1Pod() },
|
||||||
|
};
|
||||||
|
|
||||||
|
// ensure no sytax err
|
||||||
|
foreach (var pod in pods)
|
||||||
|
{
|
||||||
|
Assert.NotNull(pod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user