public virtual async void TestByUserIdFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); List <ApiBadgeClientResponseModel> response = await client.ByBadgeByUserId(1); response.Should().NotBeEmpty(); response[0].Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response[0].Id.Should().Be(1); response[0].Name.Should().Be("A"); response[0].UserId.Should().Be(1); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiPostTypeClientResponseModel response = await client.PostTypeGetAsync(1); response.Should().NotBeNull(); response.Id.Should().Be(1); response.RwType.Should().Be("A"); }
public virtual async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); var mapper = new ApiPostHistoryServerModelMapper(); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IPostHistoryService service = testServer.Host.Services.GetService(typeof(IPostHistoryService)) as IPostHistoryService; ApiPostHistoryServerResponseModel model = await service.Get(1); ApiPostHistoryClientRequestModel request = mapper.MapServerResponseToClientRequest(model); request.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), 1, 1, "B", "B", "B", 1); UpdateResponse <ApiPostHistoryClientResponseModel> updateResponse = await client.PostHistoryUpdateAsync(model.Id, request); context.Entry(context.Set <PostHistory>().ToList()[0]).Reload(); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); updateResponse.Record.Id.Should().Be(1); context.Set <PostHistory>().ToList()[0].Comment.Should().Be("B"); context.Set <PostHistory>().ToList()[0].CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <PostHistory>().ToList()[0].PostHistoryTypeId.Should().Be(1); context.Set <PostHistory>().ToList()[0].PostId.Should().Be(1); context.Set <PostHistory>().ToList()[0].RevisionGUID.Should().Be("B"); context.Set <PostHistory>().ToList()[0].Text.Should().Be("B"); context.Set <PostHistory>().ToList()[0].UserDisplayName.Should().Be("B"); context.Set <PostHistory>().ToList()[0].UserId.Should().Be(1); updateResponse.Record.Id.Should().Be(1); updateResponse.Record.Comment.Should().Be("B"); updateResponse.Record.CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); updateResponse.Record.PostHistoryTypeId.Should().Be(1); updateResponse.Record.PostId.Should().Be(1); updateResponse.Record.RevisionGUID.Should().Be("B"); updateResponse.Record.Text.Should().Be("B"); updateResponse.Record.UserDisplayName.Should().Be("B"); updateResponse.Record.UserId.Should().Be(1); }
public virtual async void TestByWikiPostIdFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); List <ApiTagClientResponseModel> response = await client.ByTagByWikiPostId(1); response.Should().NotBeEmpty(); response[0].Count.Should().Be(1); response[0].ExcerptPostId.Should().Be(1); response[0].Id.Should().Be(1); response[0].TagName.Should().Be("A"); response[0].WikiPostId.Should().Be(1); }
public virtual async void TestAll() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); List <ApiPostLinkClientResponseModel> response = await client.PostLinkAllAsync(); response.Count.Should().BeGreaterThan(0); response[0].CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response[0].Id.Should().Be(1); response[0].LinkTypeId.Should().Be(1); response[0].PostId.Should().Be(1); response[0].RelatedPostId.Should().Be(1); }
public virtual async void TestCreate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; var model = new ApiPostTypeClientRequestModel(); model.SetProperties("B"); CreateResponse <ApiPostTypeClientResponseModel> result = await client.PostTypeCreateAsync(model); result.Success.Should().BeTrue(); result.Record.Should().NotBeNull(); context.Set <PostType>().ToList()[1].RwType.Should().Be("B"); result.Record.RwType.Should().Be("B"); }
public virtual async void TestBulkInsert() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; var model = new ApiCommentClientRequestModel(); model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), 1, 2, "B", 1); var model2 = new ApiCommentClientRequestModel(); model2.SetProperties(DateTime.Parse("1/1/1989 12:00:00 AM"), 1, 3, "C", 1); var request = new List <ApiCommentClientRequestModel>() { model, model2 }; CreateResponse <List <ApiCommentClientResponseModel> > result = await client.CommentBulkInsertAsync(request); result.Success.Should().BeTrue(); result.Record.Should().NotBeNull(); context.Set <Comment>().ToList()[1].CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Comment>().ToList()[1].PostId.Should().Be(1); context.Set <Comment>().ToList()[1].Score.Should().Be(2); context.Set <Comment>().ToList()[1].Text.Should().Be("B"); context.Set <Comment>().ToList()[1].UserId.Should().Be(1); context.Set <Comment>().ToList()[2].CreationDate.Should().Be(DateTime.Parse("1/1/1989 12:00:00 AM")); context.Set <Comment>().ToList()[2].PostId.Should().Be(1); context.Set <Comment>().ToList()[2].Score.Should().Be(3); context.Set <Comment>().ToList()[2].Text.Should().Be("C"); context.Set <Comment>().ToList()[2].UserId.Should().Be(1); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiVoteClientResponseModel response = await client.VoteGetAsync(1); response.Should().NotBeNull(); response.BountyAmount.Should().Be(1); response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be(1); response.PostId.Should().Be(1); response.UserId.Should().Be(1); response.VoteTypeId.Should().Be(1); }
public virtual async void TestBulkInsert() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; var model = new ApiTagClientRequestModel(); model.SetProperties(2, 1, "B", 1); var model2 = new ApiTagClientRequestModel(); model2.SetProperties(3, 1, "C", 1); var request = new List <ApiTagClientRequestModel>() { model, model2 }; CreateResponse <List <ApiTagClientResponseModel> > result = await client.TagBulkInsertAsync(request); result.Success.Should().BeTrue(); result.Record.Should().NotBeNull(); context.Set <Tag>().ToList()[1].Count.Should().Be(2); context.Set <Tag>().ToList()[1].ExcerptPostId.Should().Be(1); context.Set <Tag>().ToList()[1].TagName.Should().Be("B"); context.Set <Tag>().ToList()[1].WikiPostId.Should().Be(1); context.Set <Tag>().ToList()[2].Count.Should().Be(3); context.Set <Tag>().ToList()[2].ExcerptPostId.Should().Be(1); context.Set <Tag>().ToList()[2].TagName.Should().Be("C"); context.Set <Tag>().ToList()[2].WikiPostId.Should().Be(1); }
public virtual async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); var mapper = new ApiTagServerModelMapper(); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ITagService service = testServer.Host.Services.GetService(typeof(ITagService)) as ITagService; ApiTagServerResponseModel model = await service.Get(1); ApiTagClientRequestModel request = mapper.MapServerResponseToClientRequest(model); request.SetProperties(2, 1, "B", 1); UpdateResponse <ApiTagClientResponseModel> updateResponse = await client.TagUpdateAsync(model.Id, request); context.Entry(context.Set <Tag>().ToList()[0]).Reload(); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); updateResponse.Record.Id.Should().Be(1); context.Set <Tag>().ToList()[0].Count.Should().Be(2); context.Set <Tag>().ToList()[0].ExcerptPostId.Should().Be(1); context.Set <Tag>().ToList()[0].TagName.Should().Be("B"); context.Set <Tag>().ToList()[0].WikiPostId.Should().Be(1); updateResponse.Record.Id.Should().Be(1); updateResponse.Record.Count.Should().Be(2); updateResponse.Record.ExcerptPostId.Should().Be(1); updateResponse.Record.TagName.Should().Be("B"); updateResponse.Record.WikiPostId.Should().Be(1); }
public virtual async void TestCreate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; var model = new ApiPostHistoryClientRequestModel(); model.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), 1, 1, "B", "B", "B", 1); CreateResponse <ApiPostHistoryClientResponseModel> result = await client.PostHistoryCreateAsync(model); result.Success.Should().BeTrue(); result.Record.Should().NotBeNull(); context.Set <PostHistory>().ToList()[1].Comment.Should().Be("B"); context.Set <PostHistory>().ToList()[1].CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <PostHistory>().ToList()[1].PostHistoryTypeId.Should().Be(1); context.Set <PostHistory>().ToList()[1].PostId.Should().Be(1); context.Set <PostHistory>().ToList()[1].RevisionGUID.Should().Be("B"); context.Set <PostHistory>().ToList()[1].Text.Should().Be("B"); context.Set <PostHistory>().ToList()[1].UserDisplayName.Should().Be("B"); context.Set <PostHistory>().ToList()[1].UserId.Should().Be(1); result.Record.Comment.Should().Be("B"); result.Record.CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); result.Record.PostHistoryTypeId.Should().Be(1); result.Record.PostId.Should().Be(1); result.Record.RevisionGUID.Should().Be("B"); result.Record.Text.Should().Be("B"); result.Record.UserDisplayName.Should().Be("B"); result.Record.UserId.Should().Be(1); }
public virtual async void TestGetFound() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; ApiPostClientResponseModel response = await client.PostGetAsync(1); response.Should().NotBeNull(); response.AcceptedAnswerId.Should().Be(1); response.AnswerCount.Should().Be(1); response.Body.Should().Be("A"); response.ClosedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.CommentCount.Should().Be(1); response.CommunityOwnedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.FavoriteCount.Should().Be(1); response.Id.Should().Be(1); response.LastActivityDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.LastEditDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.LastEditorDisplayName.Should().Be("A"); response.LastEditorUserId.Should().Be(1); response.OwnerUserId.Should().Be(1); response.ParentId.Should().Be(1); response.PostTypeId.Should().Be(1); response.Score.Should().Be(1); response.Tag.Should().Be("A"); response.Title.Should().Be("A"); response.ViewCount.Should().Be(1); }
public virtual async void TestBulkInsert() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; var model = new ApiPostClientRequestModel(); model.SetProperties(2, 2, "B", DateTime.Parse("1/1/1988 12:00:00 AM"), 2, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), 2, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), "B", 1, 1, 1, 1, 2, "B", "B", 2); var model2 = new ApiPostClientRequestModel(); model2.SetProperties(3, 3, "C", DateTime.Parse("1/1/1989 12:00:00 AM"), 3, DateTime.Parse("1/1/1989 12:00:00 AM"), DateTime.Parse("1/1/1989 12:00:00 AM"), 3, DateTime.Parse("1/1/1989 12:00:00 AM"), DateTime.Parse("1/1/1989 12:00:00 AM"), "C", 1, 1, 1, 1, 3, "C", "C", 3); var request = new List <ApiPostClientRequestModel>() { model, model2 }; CreateResponse <List <ApiPostClientResponseModel> > result = await client.PostBulkInsertAsync(request); result.Success.Should().BeTrue(); result.Record.Should().NotBeNull(); context.Set <Post>().ToList()[1].AcceptedAnswerId.Should().Be(2); context.Set <Post>().ToList()[1].AnswerCount.Should().Be(2); context.Set <Post>().ToList()[1].Body.Should().Be("B"); context.Set <Post>().ToList()[1].ClosedDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[1].CommentCount.Should().Be(2); context.Set <Post>().ToList()[1].CommunityOwnedDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[1].CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[1].FavoriteCount.Should().Be(2); context.Set <Post>().ToList()[1].LastActivityDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[1].LastEditDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[1].LastEditorDisplayName.Should().Be("B"); context.Set <Post>().ToList()[1].LastEditorUserId.Should().Be(1); context.Set <Post>().ToList()[1].OwnerUserId.Should().Be(1); context.Set <Post>().ToList()[1].ParentId.Should().Be(1); context.Set <Post>().ToList()[1].PostTypeId.Should().Be(1); context.Set <Post>().ToList()[1].Score.Should().Be(2); context.Set <Post>().ToList()[1].Tag.Should().Be("B"); context.Set <Post>().ToList()[1].Title.Should().Be("B"); context.Set <Post>().ToList()[1].ViewCount.Should().Be(2); context.Set <Post>().ToList()[2].AcceptedAnswerId.Should().Be(3); context.Set <Post>().ToList()[2].AnswerCount.Should().Be(3); context.Set <Post>().ToList()[2].Body.Should().Be("C"); context.Set <Post>().ToList()[2].ClosedDate.Should().Be(DateTime.Parse("1/1/1989 12:00:00 AM")); context.Set <Post>().ToList()[2].CommentCount.Should().Be(3); context.Set <Post>().ToList()[2].CommunityOwnedDate.Should().Be(DateTime.Parse("1/1/1989 12:00:00 AM")); context.Set <Post>().ToList()[2].CreationDate.Should().Be(DateTime.Parse("1/1/1989 12:00:00 AM")); context.Set <Post>().ToList()[2].FavoriteCount.Should().Be(3); context.Set <Post>().ToList()[2].LastActivityDate.Should().Be(DateTime.Parse("1/1/1989 12:00:00 AM")); context.Set <Post>().ToList()[2].LastEditDate.Should().Be(DateTime.Parse("1/1/1989 12:00:00 AM")); context.Set <Post>().ToList()[2].LastEditorDisplayName.Should().Be("C"); context.Set <Post>().ToList()[2].LastEditorUserId.Should().Be(1); context.Set <Post>().ToList()[2].OwnerUserId.Should().Be(1); context.Set <Post>().ToList()[2].ParentId.Should().Be(1); context.Set <Post>().ToList()[2].PostTypeId.Should().Be(1); context.Set <Post>().ToList()[2].Score.Should().Be(3); context.Set <Post>().ToList()[2].Tag.Should().Be("C"); context.Set <Post>().ToList()[2].Title.Should().Be("C"); context.Set <Post>().ToList()[2].ViewCount.Should().Be(3); }
public virtual async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); client.SetBearerToken(JWTTestHelper.GenerateBearerToken()); var mapper = new ApiPostServerModelMapper(); ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; IPostService service = testServer.Host.Services.GetService(typeof(IPostService)) as IPostService; ApiPostServerResponseModel model = await service.Get(1); ApiPostClientRequestModel request = mapper.MapServerResponseToClientRequest(model); request.SetProperties(2, 2, "B", DateTime.Parse("1/1/1988 12:00:00 AM"), 2, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), 2, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), "B", 1, 1, 1, 1, 2, "B", "B", 2); UpdateResponse <ApiPostClientResponseModel> updateResponse = await client.PostUpdateAsync(model.Id, request); context.Entry(context.Set <Post>().ToList()[0]).Reload(); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); updateResponse.Record.Id.Should().Be(1); context.Set <Post>().ToList()[0].AcceptedAnswerId.Should().Be(2); context.Set <Post>().ToList()[0].AnswerCount.Should().Be(2); context.Set <Post>().ToList()[0].Body.Should().Be("B"); context.Set <Post>().ToList()[0].ClosedDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[0].CommentCount.Should().Be(2); context.Set <Post>().ToList()[0].CommunityOwnedDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[0].CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[0].FavoriteCount.Should().Be(2); context.Set <Post>().ToList()[0].LastActivityDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[0].LastEditDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); context.Set <Post>().ToList()[0].LastEditorDisplayName.Should().Be("B"); context.Set <Post>().ToList()[0].LastEditorUserId.Should().Be(1); context.Set <Post>().ToList()[0].OwnerUserId.Should().Be(1); context.Set <Post>().ToList()[0].ParentId.Should().Be(1); context.Set <Post>().ToList()[0].PostTypeId.Should().Be(1); context.Set <Post>().ToList()[0].Score.Should().Be(2); context.Set <Post>().ToList()[0].Tag.Should().Be("B"); context.Set <Post>().ToList()[0].Title.Should().Be("B"); context.Set <Post>().ToList()[0].ViewCount.Should().Be(2); updateResponse.Record.Id.Should().Be(1); updateResponse.Record.AcceptedAnswerId.Should().Be(2); updateResponse.Record.AnswerCount.Should().Be(2); updateResponse.Record.Body.Should().Be("B"); updateResponse.Record.ClosedDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); updateResponse.Record.CommentCount.Should().Be(2); updateResponse.Record.CommunityOwnedDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); updateResponse.Record.CreationDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); updateResponse.Record.FavoriteCount.Should().Be(2); updateResponse.Record.LastActivityDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); updateResponse.Record.LastEditDate.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM")); updateResponse.Record.LastEditorDisplayName.Should().Be("B"); updateResponse.Record.LastEditorUserId.Should().Be(1); updateResponse.Record.OwnerUserId.Should().Be(1); updateResponse.Record.ParentId.Should().Be(1); updateResponse.Record.PostTypeId.Should().Be(1); updateResponse.Record.Score.Should().Be(2); updateResponse.Record.Tag.Should().Be("B"); updateResponse.Record.Title.Should().Be("B"); updateResponse.Record.ViewCount.Should().Be(2); }