You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
1.5 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rhino.Mocks;
using Sevomin.Models;
using Sevomin.Models.Repositories;
namespace Sevomin.Tests
{
public class FakeJobRepository
{
private static IJobRepository _JobRepository;
private static IQueryable<Job> _Job;
static FakeJobRepository()
{
Init();
}
internal static void Init()
{
//_Job = (new List<Job>() {
// new Job{ id = 1, Name = "A", TaskDefinitions = new List<TaskDefinition>()},
// new Job{ id = 2, Name = "B", TaskDefinitions = new List<TaskDefinition>() }
//}).AsQueryable();
//_JobRepository = MockRepository.GenerateStub<IJobRepository>();
//_JobRepository.Stub(x => x.Find(Arg<long>.Is.Anything))
// .WhenCalled(x => x.ReturnValue = _Job.FirstOrDefault(y => y.id == (long)x.Arguments[0]))
// .Return(new Job());
//_JobRepository.Stub(x => x.ListAll()).Return(_Job);
//_JobRepository.Stub(x => x.FindByUsername("new-mission"))
// .Return(null);
//_JobRepository.Stub(x => x.FindByUsername(Arg<string>.Is.Anything))
// .Return(new Job() { id = 1, Username = "test", Name = "A", TaskDefinitions = new List<TaskDefinition>() });
}
internal static IJobRepository Instance()
{
return _JobRepository;
}
}
}