File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
LinkDotNet.Blog.IntegrationTests/Web/Pages/Admin
LinkDotNet.Blog.UnitTests/Web/Shared/Admin Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 8
8
using LinkDotNet . Blog . Infrastructure . Persistence ;
9
9
using LinkDotNet . Blog . TestUtilities ;
10
10
using LinkDotNet . Blog . Web . Pages . Admin ;
11
+ using LinkDotNet . Blog . Web . Shared ;
11
12
using LinkDotNet . Blog . Web . Shared . Admin ;
12
13
using Microsoft . EntityFrameworkCore ;
13
14
using Microsoft . Extensions . DependencyInjection ;
@@ -28,6 +29,7 @@ public async Task ShouldSaveBlogPostOnSave()
28
29
ctx . AddTestAuthorization ( ) . SetAuthorized ( "some username" ) ;
29
30
ctx . Services . AddScoped < IRepository < BlogPost > > ( _ => Repository ) ;
30
31
ctx . Services . AddScoped ( _ => toastService . Object ) ;
32
+ ctx . ComponentFactories . AddStub < UploadFile > ( ) ;
31
33
using var cut = ctx . RenderComponent < UpdateBlogPostPage > (
32
34
p => p . Add ( s => s . BlogPostId , blogPost . Id ) ) ;
33
35
var newBlogPost = cut . FindComponent < CreateNewBlogPost > ( ) ;
@@ -60,4 +62,4 @@ private static void TriggerUpdate(IRenderedFragment cut)
60
62
61
63
cut . Find ( "form" ) . Submit ( ) ;
62
64
}
63
- }
65
+ }
Original file line number Diff line number Diff line change 4
4
using FluentAssertions ;
5
5
using LinkDotNet . Blog . Domain ;
6
6
using LinkDotNet . Blog . TestUtilities ;
7
+ using LinkDotNet . Blog . Web . Shared ;
7
8
using LinkDotNet . Blog . Web . Shared . Admin ;
8
9
using Xunit ;
9
10
10
11
namespace LinkDotNet . Blog . UnitTests . Web . Shared . Admin ;
11
12
12
13
public class CreateNewBlogPostTests : TestContext
13
14
{
15
+ public CreateNewBlogPostTests ( )
16
+ {
17
+ ComponentFactories . AddStub < UploadFile > ( ) ;
18
+ }
19
+
14
20
[ Fact ]
15
21
public void ShouldCreateNewBlogPostWhenValidDataGiven ( )
16
22
{
@@ -161,4 +167,4 @@ public void ShouldAcceptInputWithoutLosingFocusOrEnter()
161
167
blogPost . Tags . Should ( ) . HaveCount ( 3 ) ;
162
168
blogPost . Tags . Select ( t => t . Content ) . Should ( ) . Contain ( new [ ] { "Tag1" , "Tag2" , "Tag3" } ) ;
163
169
}
164
- }
170
+ }
You can’t perform that action at this time.
0 commit comments