* gen v1.23.0 * fix converter * bump ver * update readme runtime * fix warning * update dep ver * newtonjson -> system.text.json * generate for new json api * readme lf * dotnet fmt * dotnet fmt tests/ * dotnet fmt * Revert "dotnet fmt" This reverts commit e14c59076143fe2218ed899295a00762f0ea2bd6. * fix err introduce by dotnet fmt * fix test * remove deprecated /watch api * generate code after /watch removed * remove /watch related code * trim Microsoft.Rest.Serialization
39 lines
887 B
C#
39 lines
887 B
C#
using k8s.Models;
|
|
using Xunit;
|
|
|
|
namespace k8s.Tests
|
|
{
|
|
public class IntOrStringTests
|
|
{
|
|
[Fact]
|
|
public void Serialize()
|
|
{
|
|
{
|
|
var v = 123;
|
|
IntstrIntOrString intorstr = v;
|
|
|
|
Assert.Equal("123", KubernetesJson.Serialize(intorstr));
|
|
}
|
|
|
|
{
|
|
IntstrIntOrString intorstr = "12%";
|
|
Assert.Equal("\"12%\"", KubernetesJson.Serialize(intorstr));
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void Deserialize()
|
|
{
|
|
{
|
|
var v = KubernetesJson.Deserialize<IntstrIntOrString>("1234");
|
|
Assert.Equal("1234", v.Value);
|
|
}
|
|
|
|
{
|
|
var v = KubernetesJson.Deserialize<IntstrIntOrString>("\"12%\"");
|
|
Assert.Equal("12%", v.Value);
|
|
}
|
|
}
|
|
}
|
|
}
|