Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Commit 30bf403

Browse files
committed
Chore: Move conversion tests.
1 parent 876ae1d commit 30bf403

3 files changed

Lines changed: 13 additions & 23 deletions

File tree

PhpSerializerNET.Test/Deserialize/DoubleDeserialization.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,12 @@ public void DeserializesToNullable() {
7979
PhpSerialization.Deserialize<double?>("d:3.1415;")
8080
);
8181
}
82+
83+
[TestMethod]
84+
public void DeserializeDoubleToInt() {
85+
double number = PhpSerialization.Deserialize<double>("d:10;");
86+
Assert.AreEqual((long)10, number);
87+
}
88+
8289
}
8390
}

PhpSerializerNET.Test/Deserialize/IntegerDeserialization.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public void DeserializeIntMinValue() {
5252
);
5353
}
5454

55+
[TestMethod]
56+
public void DeserializeIntToDouble() {
57+
double number = PhpSerialization.Deserialize<double>("i:10;");
58+
Assert.AreEqual(10.00, number);
59+
}
60+
5561
[TestMethod]
5662
public void ExplictCastFormatException() {
5763
var ex = Assert.ThrowsException<PhpSerializerNET.DeserializationException>(() =>

PhpSerializerNET.Test/SerializePrimitives.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)