mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixed failing unit tests.
This commit is contained in:
@@ -16,6 +16,9 @@ using Orchard.Recipes.Services;
|
|||||||
using Orchard.Services;
|
using Orchard.Services;
|
||||||
using Orchard.Tests.Stubs;
|
using Orchard.Tests.Stubs;
|
||||||
using Orchard.Recipes.Events;
|
using Orchard.Recipes.Events;
|
||||||
|
using Orchard.Data;
|
||||||
|
using System;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Orchard.Tests.Modules.Recipes.Services {
|
namespace Orchard.Tests.Modules.Recipes.Services {
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
@@ -83,6 +86,7 @@ namespace Orchard.Tests.Modules.Recipes.Services {
|
|||||||
builder.RegisterType<RecipeParser>().As<IRecipeParser>();
|
builder.RegisterType<RecipeParser>().As<IRecipeParser>();
|
||||||
builder.RegisterType<StubWebSiteFolder>().As<IWebSiteFolder>();
|
builder.RegisterType<StubWebSiteFolder>().As<IWebSiteFolder>();
|
||||||
builder.RegisterType<CustomRecipeHandler>().As<IRecipeHandler>();
|
builder.RegisterType<CustomRecipeHandler>().As<IRecipeHandler>();
|
||||||
|
builder.RegisterInstance(new StubRecipeStepResultRecordRepository()).As<IRepository<RecipeStepResultRecord>>();
|
||||||
|
|
||||||
_container = builder.Build();
|
_container = builder.Build();
|
||||||
_recipeManager = _container.Resolve<IRecipeManager>();
|
_recipeManager = _container.Resolve<IRecipeManager>();
|
||||||
@@ -163,6 +167,22 @@ namespace Orchard.Tests.Modules.Recipes.Services {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class StubRecipeStepResultRecordRepository : IRepository<RecipeStepResultRecord> {
|
||||||
|
private List<RecipeStepResultRecord> _records = new List<RecipeStepResultRecord>();
|
||||||
|
public IQueryable<RecipeStepResultRecord> Table { get { return _records.AsQueryable(); } }
|
||||||
|
public void Copy(RecipeStepResultRecord source, RecipeStepResultRecord target) { }
|
||||||
|
public int Count(Expression<Func<RecipeStepResultRecord, bool>> predicate) { return _records.Count; }
|
||||||
|
public void Create(RecipeStepResultRecord entity) { _records.Add(entity); }
|
||||||
|
public void Delete(RecipeStepResultRecord entity) { _records.Remove(entity); }
|
||||||
|
public IEnumerable<RecipeStepResultRecord> Fetch(Expression<Func<RecipeStepResultRecord, bool>> predicate) { throw new NotImplementedException(); }
|
||||||
|
public IEnumerable<RecipeStepResultRecord> Fetch(Expression<Func<RecipeStepResultRecord, bool>> predicate, Action<Orderable<RecipeStepResultRecord>> order) { throw new NotImplementedException(); }
|
||||||
|
public IEnumerable<RecipeStepResultRecord> Fetch(Expression<Func<RecipeStepResultRecord, bool>> predicate, Action<Orderable<RecipeStepResultRecord>> order, int skip, int count) { throw new NotImplementedException(); }
|
||||||
|
public void Flush() { }
|
||||||
|
public RecipeStepResultRecord Get(Expression<Func<RecipeStepResultRecord, bool>> predicate) { throw new NotImplementedException(); }
|
||||||
|
public RecipeStepResultRecord Get(int id) { throw new NotImplementedException(); }
|
||||||
|
public void Update(RecipeStepResultRecord entity) { }
|
||||||
|
}
|
||||||
|
|
||||||
public class StubRecipeScheduler : IRecipeScheduler {
|
public class StubRecipeScheduler : IRecipeScheduler {
|
||||||
private readonly IRecipeStepExecutor _recipeStepExecutor;
|
private readonly IRecipeStepExecutor _recipeStepExecutor;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user