Skip to content

Commit f646f03

Browse files
Add additional service registration tests
1 parent 376c3cc commit f646f03

5 files changed

Lines changed: 252 additions & 139 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using SixLabors.ImageSharp.Web.Caching;
5+
6+
namespace SixLabors.ImageSharp.Web.Tests.DependencyInjection
7+
{
8+
public class MockCacheHash : ICacheHash
9+
{
10+
public string Create(string value, uint length) => null;
11+
}
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using Microsoft.AspNetCore.Http;
5+
using SixLabors.ImageSharp.Web.Caching;
6+
using SixLabors.ImageSharp.Web.Commands;
7+
8+
namespace SixLabors.ImageSharp.Web.Tests.DependencyInjection
9+
{
10+
public class MockCacheKey : ICacheKey
11+
{
12+
public string Create(HttpContext context, CommandCollection commands) => null;
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using System.IO;
5+
using System.Threading.Tasks;
6+
using SixLabors.ImageSharp.Web.Caching;
7+
using SixLabors.ImageSharp.Web.Resolvers;
8+
9+
namespace SixLabors.ImageSharp.Web.Tests.DependencyInjection
10+
{
11+
public class MockImageCache : IImageCache
12+
{
13+
public Task<IImageCacheResolver> GetAsync(string key) => Task.FromResult<IImageCacheResolver>(null);
14+
15+
public Task SetAsync(string key, Stream stream, ImageCacheMetadata metadata) => Task.CompletedTask;
16+
}
17+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using Microsoft.AspNetCore.Http;
5+
using SixLabors.ImageSharp.Web.Commands;
6+
7+
namespace SixLabors.ImageSharp.Web.Tests.DependencyInjection
8+
{
9+
public class MockRequestParser : IRequestParser
10+
{
11+
public CommandCollection ParseRequestCommands(HttpContext context) => null;
12+
}
13+
}

0 commit comments

Comments
 (0)