generated from nventive/Template
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathEditPostPageViewModelShould.cs
More file actions
39 lines (31 loc) · 1.04 KB
/
EditPostPageViewModelShould.cs
File metadata and controls
39 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ApplicationTemplate.Tests;
using Xunit.Abstractions;
namespace Posts;
public sealed class EditPostPageViewModelShould : FunctionalTestBase
{
public EditPostPageViewModelShould(ITestOutputHelper output) : base(output)
{
}
[Fact]
public async Task ShowPostDetails()
{
// Arrange & Act
await this.Login(await this.ReachLoginPage());
await Menu.ShowPostsSection.Execute();
var postsVM = GetAndAssertActiveViewModel<PostsPageViewModel>();
var postItemViewModels = await postsVM.Posts.Load(CancellationToken.None) as ImmutableList<PostItemViewModel>;
var postItemViewModel = postItemViewModels.First();
var post = postItemViewModel.Post;
await postItemViewModel.EditPost.Execute();
var sut = GetAndAssertActiveViewModel<EditPostPageViewModel>();
// Assert
sut.Title.Should().Be(post.Title);
sut.IsNewPost.Should().BeFalse();
sut.Form.Title.Should().Be(post.Title);
sut.Form.Body.Should().Be(post.Body);
}
}