File tree 2 files changed +33
-1
lines changed
CreatingNavigationAndComponents
WorkingWithServicesAndData 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public void AddNavigationNavLinkTest()
33
33
34
34
var firstNavLink = firstLi . Descendants ( "NavLink" ) . FirstOrDefault ( ) ;
35
35
Assert . True ( firstNavLink != null && firstNavLink . Attributes [ "href" ] ? . Value == "" && firstNavLink . InnerText == "Home" ,
36
- "The first `li` element should contain a `NavLink` component with with an `href` set to `\" \" ` and contain the text `\" Home\" `." ) ;
36
+ "The first `li` element should contain a `NavLink` component with with an `href` set to `\" \" ` and contain the text `\" Home\" `." ) ;
37
37
38
38
var secondNavLink = secondLi . Descendants ( "NavLink" ) . FirstOrDefault ( ) ;
39
39
Assert . True ( secondNavLink != null && secondNavLink . Attributes [ "href" ] ? . Value == "/new-bug" && secondNavLink . InnerText == "New Bug" ,
Original file line number Diff line number Diff line change
1
+ using HtmlAgilityPack ;
2
+ using System ;
3
+ using System . Collections . Generic ;
4
+ using System . IO ;
5
+ using System . Linq ;
6
+ using System . Text ;
7
+ using Xunit ;
8
+ using BugTrackerUI . Tests ;
9
+
10
+ namespace M3_BugTrackerUI . Tests . CreatingNewBugForm
11
+ {
12
+ public class M4_07_UpdateEditFormSubmitTests
13
+ {
14
+ [ Fact ( DisplayName = "Update the EditForm Component submit @update-editform-submit" ) ]
15
+ public void M4_07_UpdateEditFormSubmitTest ( )
16
+ {
17
+ var filePath = TestHelpers . GetRootString ( ) + "BugTrackerUI"
18
+ + Path . DirectorySeparatorChar + "Pages"
19
+ + Path . DirectorySeparatorChar + "NewBug.razor" ;
20
+
21
+ Assert . True ( File . Exists ( filePath ) , "`NewBug.razor` should exist in the `Pages` folder." ) ;
22
+
23
+ var doc = new HtmlDocument ( ) ;
24
+ doc . Load ( filePath ) ;
25
+
26
+ var editForm = doc . DocumentNode . Descendants ( "EditForm" ) ? . FirstOrDefault ( ) ;
27
+
28
+ Assert . True ( editForm != null && editForm . Attributes [ "OnValidSubmit" ] ? . Value == "@HandleValidSubmit" ,
29
+ @"The `NewBug` component element should contain an `EditForm` component with with a `OnValidSubmit` attribute set to `@HandleValidSubmit`." ) ;
30
+ }
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments