Skip to content

Commit 11a5a2c

Browse files
committed
Fixing tests and couple minor issues
1 parent dc89c59 commit 11a5a2c

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

src/Core/Api/AuthorsController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public async Task<ActionResult<Author>> Get(string author)
6060
{
6161
try
6262
{
63-
var result = _data.Authors.GetItem(a => a.AppUserName == author, !User.Identity.IsAuthenticated);
63+
var result = await _data.Authors.GetItem(a => a.AppUserName == author, !User.Identity.IsAuthenticated);
6464
if (result == null) return NotFound();
6565

66-
return Ok(await Task.FromResult(result));
66+
return Ok(result);
6767
}
6868
catch (Exception)
6969
{

src/Core/Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5-
<Version>2.3.1.6</Version>
5+
<Version>2.3.1.7</Version>
66
</PropertyGroup>
77

88
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

src/Core/CoreAPI.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Core/Services/StorageService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ public void DeleteAuthor(string name)
305305

306306
public void DeleteFile(string path)
307307
{
308+
path = path.SanitizeFileName();
308309
path = path.Replace("/", _separator);
309310
path = path.Replace($"{_uploadFolder}{_separator}{_blogSlug}{_separator}", "");
310311
File.Delete(GetFullPath(path));

tests/Core.Tests/Services/ImportServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void SetupDependencies()
6666
_unitOfWork.Setup(x => x.BlogPosts).Returns(_postsRepository.Object);
6767

6868
_authorRepository
69-
.Setup(x => x.GetItem(It.IsAny<Expression<Func<Author, bool>>>()))
69+
.Setup(x => x.GetItem(It.IsAny<Expression<Func<Author, bool>>>(), false))
7070
.Returns(Task.FromResult(new Author
7171
{
7272
Id = 1,

tests/Core.Tests/Services/SyndicationServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private FeedService GetSut()
3232
private void SetupDependencies()
3333
{
3434
authorRepository
35-
.Setup(x => x.GetItem(It.IsAny<Expression<Func<Author, bool>>>()))
35+
.Setup(x => x.GetItem(It.IsAny<Expression<Func<Author, bool>>>(), false))
3636
.Returns(Task.FromResult(new Author
3737
{
3838
Id = 1,

0 commit comments

Comments
 (0)