diff --git a/Conduit/Conduit.Tests/TestHelpers/Dto/Handlers/CreateArticleRequestHelper.cs b/Conduit/Conduit.Tests/TestHelpers/Dto/Handlers/CreateArticleRequestHelper.cs index 83b9f65612..10275e459a 100644 --- a/Conduit/Conduit.Tests/TestHelpers/Dto/Handlers/CreateArticleRequestHelper.cs +++ b/Conduit/Conduit.Tests/TestHelpers/Dto/Handlers/CreateArticleRequestHelper.cs @@ -37,7 +37,7 @@ public static CreateArticleRequest Create( Body = body, Description = description, Title = title, - Tags = tags + TagList = tags } }; diff --git a/Conduit/Conduit.Tests/TestHelpers/Dto/ViewModels/CreateArticleSubmitModelHelper.cs b/Conduit/Conduit.Tests/TestHelpers/Dto/ViewModels/CreateArticleSubmitModelHelper.cs index 0359853618..54256c087d 100644 --- a/Conduit/Conduit.Tests/TestHelpers/Dto/ViewModels/CreateArticleSubmitModelHelper.cs +++ b/Conduit/Conduit.Tests/TestHelpers/Dto/ViewModels/CreateArticleSubmitModelHelper.cs @@ -23,7 +23,7 @@ public static CreateArticleSubmitModel Create( Title = title, Description = description, Body = body, - Tags = tags + TagList = tags }; return model; } diff --git a/Conduit/Conduit.Tests/Unit/Articles/Handlers/CreateArticleHandlerTests.cs b/Conduit/Conduit.Tests/Unit/Articles/Handlers/CreateArticleHandlerTests.cs index 78b0d7a5c3..5c7dab4487 100644 --- a/Conduit/Conduit.Tests/Unit/Articles/Handlers/CreateArticleHandlerTests.cs +++ b/Conduit/Conduit.Tests/Unit/Articles/Handlers/CreateArticleHandlerTests.cs @@ -102,7 +102,7 @@ public async Task Tags_must_be_on_the_approved_list() { // arrange var request = CreateArticleRequestHelper.Create(); - request.ArticleSubmission.Article.Tags = new List + request.ArticleSubmission.Article.TagList = new List { "not-approved-tag-" + Path.GetRandomFileName() }; @@ -183,14 +183,14 @@ public async Task Tag_list_is_passed_through() { // arrange var request = CreateArticleRequestHelper.Create(); - request.ArticleSubmission.Article.Tags = _allTags.Take(1).ToList(); + request.ArticleSubmission.Article.TagList = _allTags.Take(1).ToList(); // act var result = await _handler.Handle(request, CancellationToken.None); // assert Assert.That(result, Is.Not.Null); - Assert.That(result.Article.TagList.Contains(request.ArticleSubmission.Article.Tags.Single()), Is.True); + Assert.That(result.Article.TagList.Contains(request.ArticleSubmission.Article.TagList.Single()), Is.True); } [Test] @@ -213,7 +213,7 @@ public async Task Favorited_is_initially_false_FavoritesCount_is_zero() { // arrange var request = CreateArticleRequestHelper.Create(); - request.ArticleSubmission.Article.Tags = _allTags.Take(1).ToList(); + request.ArticleSubmission.Article.TagList = _allTags.Take(1).ToList(); // act var result = await _handler.Handle(request, CancellationToken.None); diff --git a/Conduit/Conduit.Web/Articles/Handlers/CreateArticleHandler.cs b/Conduit/Conduit.Web/Articles/Handlers/CreateArticleHandler.cs index c600c8830b..82c6c373f5 100644 --- a/Conduit/Conduit.Web/Articles/Handlers/CreateArticleHandler.cs +++ b/Conduit/Conduit.Web/Articles/Handlers/CreateArticleHandler.cs @@ -38,7 +38,7 @@ public async Task Handle(CreateArticleRequest request, Ca Description = request.ArticleSubmission.Article.Description.Trim(), Body = request.ArticleSubmission.Article.Body.Trim(), Slug = _slugService.GenerateSlug(request.ArticleSubmission.Article.Title.Trim()), - TagList = request.ArticleSubmission.Article.Tags, + TagList = request.ArticleSubmission.Article.TagList, CreatedAt = new DateTimeOffset(DateTime.Now), Favorited = false, // brand new article, no one can have favorited it yet FavoritesCount = 0, // brand new article, no one can have favorited it yet diff --git a/Conduit/Conduit.Web/Articles/Handlers/CreateArticleRequestValidator.cs b/Conduit/Conduit.Web/Articles/Handlers/CreateArticleRequestValidator.cs index 811acd531c..c2ff285fa0 100644 --- a/Conduit/Conduit.Web/Articles/Handlers/CreateArticleRequestValidator.cs +++ b/Conduit/Conduit.Web/Articles/Handlers/CreateArticleRequestValidator.cs @@ -30,7 +30,7 @@ public CreateArticleRequestValidator(ITagsDataService tagsDataService) .MaximumLength(15000000).WithMessage("Body must be 15,000,000 characters or less.") .MinimumLength(10).WithMessage("Body must be 10 characters or more."); - RuleFor(x => x.ArticleSubmission.Article.Tags) + RuleFor(x => x.ArticleSubmission.Article.TagList) .Cascade(CascadeMode.Stop) .MustAsync(BeAllowedTags).WithMessage("At least one of those tags isn't allowed."); } diff --git a/Conduit/Conduit.Web/Articles/ViewModels/CreateArticleSubmitModel.cs b/Conduit/Conduit.Web/Articles/ViewModels/CreateArticleSubmitModel.cs index d4dcc82fb4..439e8447fc 100644 --- a/Conduit/Conduit.Web/Articles/ViewModels/CreateArticleSubmitModel.cs +++ b/Conduit/Conduit.Web/Articles/ViewModels/CreateArticleSubmitModel.cs @@ -27,5 +27,5 @@ public class CreateArticleSubmitModelArticle /// /// Tags, optional. Any tags specified must be from the allowed list of tags. /// - public List Tags { get; set; } + public List TagList { get; set; } } \ No newline at end of file