-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for scoped css attribute and .net preview 8 (#195)
* Added support for scoped css attribute * updated changelog
- Loading branch information
Showing
10 changed files
with
82 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/bunit.testassets/SampleComponents/ScopedCssElements.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello Pink World!</h1> |
3 changes: 3 additions & 0 deletions
3
tests/bunit.testassets/SampleComponents/ScopedCssElements.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
h1 { | ||
color: deeppink; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/bunit.web.tests/Asserting/MarkupMatchesAssertExtensionsTest.net5.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#if NET5_0 | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Bunit.TestAssets.SampleComponents; | ||
|
||
using Xunit; | ||
|
||
namespace Bunit | ||
{ | ||
public partial class MarkupMatchesAssertExtensionsTest : TestContext | ||
{ | ||
[Fact(DisplayName = "MarkupMatches correctly ignores scoped css attributes")] | ||
public void Test_net5_001() | ||
{ | ||
var cut = RenderComponent<ScopedCssElements>(); | ||
|
||
cut.MarkupMatches("<h1>Hello Pink World!</h1>"); | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/bunit.web.tests/Rendering/Internal/HtmlizerTests.net5.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#if NET5_0 | ||
using System; | ||
using Bunit.TestAssets.BlazorE2E; | ||
using Bunit.TestAssets.SampleComponents; | ||
|
||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Rendering; | ||
using Microsoft.AspNetCore.Components.Web; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Bunit.Rendering.Internal | ||
{ | ||
public partial class HtmlizerTests : TestContext | ||
{ | ||
[Theory(DisplayName = "IsBlazorAttribute correctly identifies Blazor attributes")] | ||
[InlineData("b-twl12ishk1=\"\"")] | ||
[InlineData("blazor:onclick=\"1\"")] | ||
[InlineData("blazor:__internal_stopPropagation_onclick=\"\"")] | ||
[InlineData("blazor:__internal_preventDefault_onclick=\"\"")] | ||
public void TestNET5_001(string blazorAttribute) | ||
{ | ||
Htmlizer.IsBlazorAttribute(blazorAttribute).ShouldBeTrue(); | ||
} | ||
} | ||
} | ||
#endif |