Skip to content

Commit

Permalink
Updated CodeMethodWriter test file for php
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 4, 2024
1 parent a4f4306 commit 8c6e84f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1474,9 +1474,9 @@ 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("$result->setStringValue($parseNode->getStringValue())", result);
Assert.Contains("$result->setStringValue($finalValue)", result);
Assert.Contains("else if ($parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue']) !== null) {", result);
Assert.Contains("$result->setComplexType2Value($parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue']))", result);
Assert.Contains("$result->setComplexType2Value($finalValue)", result);
Assert.Contains("return $result", result);
Assert.DoesNotContain("return new UnionTypeWrapper()", result);
AssertExtensions.Before("$parseNode->getStringValue()", "getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue'])", result);
Expand Down

0 comments on commit 8c6e84f

Please sign in to comment.