Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
eminencegrs committed Dec 2, 2024
1 parent 439aaa0 commit 8b16844
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace LeetCode.Challenges.Problems00xx.N_0094_BinaryTreeInorderTraversal;

public class Solution
public class BinaryTreeTraverser
{
public IList<int> InorderTraversal(TreeNode? root)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Diagnostics.CodeAnalysis;

namespace LeetCode.Challenges.Problems00xx.N_0094_BinaryTreeInorderTraversal;

[ExcludeFromCodeCoverage]
public class TreeNode(int value = default, TreeNode? left = null, TreeNode? right = null)
{
public int Value { get; set; } = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace LeetCode.Challenges.UnitTests.Problems00xx.N_0094_BinaryTreeInorderTraversal;

public class SolutionTests
public class BinaryTreeTraverserTests
{
[Theory]
[MemberData(nameof(TestData))]
public void GivenTree_WhenInorderTraversal_ThenResultAsExpected(TreeNode root, IList<int> expectedResult)
{
var actualResult = new Solution().InorderTraversal(root);
var actualResult = new BinaryTreeTraverser().InorderTraversal(root);
actualResult.ShouldBeEquivalentTo(expectedResult);
}

Expand Down

0 comments on commit 8b16844

Please sign in to comment.