Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shemogumbe committed Oct 22, 2024
1 parent 70bc899 commit a347783
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/Kiota.Builder.Tests/Writers/Python/CodeMethodWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.IO;
using System.Linq;
using System.Reflection;

using Kiota.Builder.CodeDOM;
using Kiota.Builder.Extensions;
using Kiota.Builder.Writers;
using Kiota.Builder.Writers.Python;
using Moq;
using Xunit;

namespace Kiota.Builder.Tests.Writers.Python;
Expand Down Expand Up @@ -829,8 +829,18 @@ public void WritesUnionDeSerializerBody()
[InlineData(false, false, "CustomType", " CustomType,")]
public void GetTypeFactory_ReturnsCorrectString(bool isVoid, bool isStream, string returnType, string expected)
{
var mockConventionService = new Mock<PythonConventionService>();

var codeMethodWriter = new CodeMethodWriter(
mockConventionService.Object,
"TestNamespace",
false // usesBackingStore
);

var methodInfo = typeof(CodeMethodWriter).GetMethod("GetTypeFactory", BindingFlags.NonPublic | BindingFlags.Instance);
var result = methodInfo.Invoke(_codeMethodWriter, new object[] { isVoid, isStream, returnType });

var result = methodInfo.Invoke(codeMethodWriter, new object[] { isVoid, isStream, returnType });

Assert.Equal(expected, result);
}
[Fact]
Expand Down

0 comments on commit a347783

Please sign in to comment.