Skip to content

Commit

Permalink
$finalValue validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Dec 5, 2024
1 parent 8c6e84f commit 8886b19
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1474,8 +1474,10 @@ public void WritesModelFactoryBodyForUnionModels()
Assert.Contains("if ('#kiota.complexType1' === $mappingValue) {", result);
Assert.Contains("$result->setComplexType1Value(new ComplexType1())", result);
Assert.Contains("if ($parseNode->getStringValue() !== null) {", result);
Assert.Contains("$finalValue = $parseNode->getStringValue()", result);
Assert.Contains("$result->setStringValue($finalValue)", result);
Assert.Contains("else if ($parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue']) !== null) {", result);
Assert.Contains("$finalValue = $parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue'])", result);
Assert.Contains("$result->setComplexType2Value($finalValue)", result);
Assert.Contains("return $result", result);
Assert.DoesNotContain("return new UnionTypeWrapper()", result);
Expand Down

0 comments on commit 8886b19

Please sign in to comment.