Skip to content

Commit

Permalink
Add code coverage for RichTextBoxActionList
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) committed Sep 13, 2024
1 parent 935f877 commit 6dfec29
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Winforms.lutconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<LUTConfig Version="1.0">
<Repository />
<ParallelBuilds>true</ParallelBuilds>
<ParallelTestRuns>true</ParallelTestRuns>
<TestCaseTimeout>180000</TestCaseTimeout>
</LUTConfig>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable

using Moq;

namespace System.Windows.Forms.Design.Tests;

public sealed class RichTextBoxActionListTests
{
//private readonly Mock<EditorServiceContext> _editorServiceContextMock = new();

private readonly RichTextBoxDesigner _designer = new();

private readonly RichTextBox _richTextBox = new();

public RichTextBoxActionListTests()
{
_richTextBox.Lines = ["Line1", "Line2", "Line3"];
_designer.Initialize(_richTextBox);
//_editorServiceContextMock.Setup(editorServiceContext => EditorServiceContext.EditValue(_designerObject, _designerMock.Object.Component, It.IsAny<string>()));
}

[Fact]
public void RichTextBoxActionList_EditLines()
{
_richTextBox.Lines = ["Line4", "Line5", "Line6"];
var actionList = new RichTextBoxActionList(_designer);
actionList.EditLines();

actionList.GetSortedActionItems().Count.Should().Be(1);
}
}

0 comments on commit 6dfec29

Please sign in to comment.