Skip to content

Commit 074b766

Browse files
committed
Test
1 parent f4eaea4 commit 074b766

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

.github/workflows/dotnet-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: .NET Core
1+
name: Build
22

33
on:
44
push:

test/WrapperValueObject.Tests/SimpleTypes.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,30 @@ public readonly partial struct LeagueId
1313
{
1414
}
1515

16+
[WrapperValueObject(typeof(int))]
17+
public readonly partial struct MeterLength
18+
{
19+
public static implicit operator CentimeterLength(MeterLength meter) => meter.Value * 100;
20+
}
21+
22+
[WrapperValueObject(typeof(int))]
23+
public readonly partial struct CentimeterLength
24+
{
25+
public static implicit operator MeterLength(CentimeterLength centiMeter) => centiMeter.Value / 100;
26+
}
27+
1628
public class SimpleTypes
1729
{
30+
[Fact]
31+
public void Test_Metric_Types()
32+
{
33+
MeterLength meters = 2;
34+
35+
CentimeterLength centiMeters = meters;
36+
37+
Assert.Equal(200, (int)centiMeters);
38+
}
39+
1840
[Fact]
1941
public void Test_Guid_Type_Equals()
2042
{

0 commit comments

Comments
 (0)